* 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:
Axel Dörfler
2009-03-02 08:23:16 +00:00
parent 2f1f4f54d6
commit 43b2ca9108
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -297,7 +297,7 @@ get_fd_locked(struct io_context *context, int fd)
struct file_descriptor * struct file_descriptor *
get_fd(struct io_context *context, int fd) get_fd(struct io_context *context, int fd)
{ {
MutexLocker(context->io_mutex); MutexLocker _(context->io_mutex);
return get_fd_locked(context, fd); return get_fd_locked(context, fd);
} }
@@ -306,7 +306,7 @@ get_fd(struct io_context *context, int fd)
struct file_descriptor * struct file_descriptor *
get_open_fd(struct io_context *context, int fd) 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); file_descriptor *descriptor = get_fd_locked(context, fd);
if (descriptor == NULL) if (descriptor == NULL)
+4 -2
View File
@@ -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); 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) if (atomic_add(&context->ref_count, -1) == 1)
vfs_free_io_context(context); vfs_free_io_context(context);