Merge pull request #5443 from coolreader18/incremental-newline-decoder

Implement IncrementalNewlineDecoder in rust
This commit is contained in:
Noa
2024-12-03 16:28:00 -06:00
committed by GitHub
16 changed files with 324 additions and 122 deletions

View File

@@ -92,6 +92,11 @@ impl<R: RawMutex, G: GetThreadId, T: Default> Default for ThreadMutex<R, G, T> {
Self::new(T::default())
}
}
impl<R: RawMutex, G: GetThreadId, T> From<T> for ThreadMutex<R, G, T> {
fn from(val: T) -> Self {
Self::new(val)
}
}
impl<R: RawMutex, G: GetThreadId, T: ?Sized> ThreadMutex<R, G, T> {
pub fn lock(&self) -> Option<ThreadMutexGuard<R, G, T>> {
if self.raw.lock() {