diff --git a/src/kernel/fileSystem.cpp b/src/kernel/fileSystem.cpp index b7cd0200e..8b5b98b4b 100644 --- a/src/kernel/fileSystem.cpp +++ b/src/kernel/fileSystem.cpp @@ -803,7 +803,7 @@ int64_t KYTY_SYSV_ABI KernelLseek(int d, int64_t offset, int whence) { return KERNEL_ERROR_ESPIPE; } - file->mutex.Lock(); + Common::LockGuard lock(file->mutex); bool is_invalid = file->f.IsInvalid(); @@ -828,8 +828,6 @@ int64_t KYTY_SYSV_ABI KernelLseek(int d, int64_t offset, int whence) { EXIT_IF(pos != offset); - file->mutex.Unlock(); - if (is_invalid) { LOGF("\tfile is invalid\n"); return KERNEL_ERROR_EIO;