[SERVER-532] wait forever in thread_pool.cpp Created: 11/Jan/10 Updated: 12/Jul/16 Resolved: 13/Jan/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
I've been seeing some hangs in ./test threading I think one problem can be fixed by this patch: diff --git a/util/thread_pool.cpp b/util/thread_pool.cpp void ThreadPool::join(){ } As is, join() might check _tasksRemaining while task_done() has the mutex but before task_done() has decremented _tasksRemaining. So race condition is: 1) task_done() grabs _mutex Not that familiar w/ the code, let me know what you think. |
| Comments |
| Comment by auto [ 12/Jan/10 ] |
|
Author: {'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: Fix race condition. |