* Fixed wrong use of MutexLocker as pointed out by Korli - nice catch! This
could have caused a number of problems. * Fixed coding style violation Ingo introduced. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29378 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2f1f4f54d6
commit
43b2ca9108
@ -297,7 +297,7 @@ get_fd_locked(struct io_context *context, int fd)
|
||||
struct file_descriptor *
|
||||
get_fd(struct io_context *context, int fd)
|
||||
{
|
||||
MutexLocker(context->io_mutex);
|
||||
MutexLocker _(context->io_mutex);
|
||||
|
||||
return get_fd_locked(context, fd);
|
||||
}
|
||||
@ -306,7 +306,7 @@ get_fd(struct io_context *context, int fd)
|
||||
struct file_descriptor *
|
||||
get_open_fd(struct io_context *context, int fd)
|
||||
{
|
||||
MutexLocker(context->io_mutex);
|
||||
MutexLocker _(context->io_mutex);
|
||||
|
||||
file_descriptor *descriptor = get_fd_locked(context, fd);
|
||||
if (descriptor == NULL)
|
||||
|
@ -4744,13 +4744,15 @@ vfs_free_io_context(io_context* context)
|
||||
}
|
||||
|
||||
|
||||
void vfs_get_io_context(io_context *context)
|
||||
void
|
||||
vfs_get_io_context(io_context* context)
|
||||
{
|
||||
atomic_add(&context->ref_count, 1);
|
||||
}
|
||||
|
||||
|
||||
void vfs_put_io_context(io_context *context)
|
||||
void
|
||||
vfs_put_io_context(io_context* context)
|
||||
{
|
||||
if (atomic_add(&context->ref_count, -1) == 1)
|
||||
vfs_free_io_context(context);
|
||||
|
Loading…
x
Reference in New Issue
Block a user