Module: wine Branch: master Commit: 5532927ed33f3682c48bdc2a2528488eeefa5bad URL: http://source.winehq.org/git/wine.git/?a=commit;h=5532927ed33f3682c48bdc2a25...
Author: Alexandre Julliard julliard@winehq.org Date: Sun May 16 12:34:28 2010 +0200
server: Make sure a thread doesn't get freed while it's processing a request.
---
server/thread.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/server/thread.c b/server/thread.c index c4deb68..67ef6cf 100644 --- a/server/thread.c +++ b/server/thread.c @@ -248,9 +248,11 @@ static void thread_poll_event( struct fd *fd, int event ) struct thread *thread = get_fd_user( fd ); assert( thread->obj.ops == &thread_ops );
+ grab_object( thread ); if (event & (POLLERR | POLLHUP)) kill_thread( thread, 0 ); else if (event & POLLIN) read_request( thread ); else if (event & POLLOUT) write_reply( thread ); + release_object( thread ); }
/* cleanup everything that is no longer needed by a dead thread */