-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
engine/activity: fixed blocking calls to ExecutionEngine::process()
Broadcasting condition variables without holding the associated mutex can block for some reasons. This patch adds MutexLocks whereever the msg_cond is triggered. From http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_cond_broadcast.html: > The pthread_cond_broadcast() or pthread_cond_signal() functions may be called by a thread whether > or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() > have associated with the condition variable during their waits; however, if predictable scheduling > behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or > pthread_cond_signal(). This patch also clears the Thread active flag in Thread::terminate() is called and forces the thread function to be terminated in the destructor of class Activity. This solves some issues with pure virtual method calls during the destruction phase if threads are still running and triggering each other. Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
- Loading branch information
Showing
3 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters