mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Merge remote-tracking branch 'origin/topic/bernhard/thread-cleanup'
* origin/topic/bernhard/thread-cleanup: and just to be really sure - always make threads go through OnWaitForStop hopefully finally fix last interesting race-condition it is apparently getting a bit late for changes at important code... spoke to soon (forgot to comment in line again). Change thread shutdown again to also work with input framework. Changing semantics of thread stop methods. Support for cleaning up threads that have terminated.
This commit is contained in:
commit
639a6410c6
18 changed files with 218 additions and 95 deletions
|
@ -228,8 +228,8 @@ protected:
|
|||
*
|
||||
*/
|
||||
virtual void Run();
|
||||
virtual void OnStop();
|
||||
virtual void OnPrepareStop();
|
||||
virtual void OnWaitForStop();
|
||||
virtual void OnSignalStop();
|
||||
virtual void OnKill();
|
||||
|
||||
private:
|
||||
|
@ -289,7 +289,8 @@ private:
|
|||
*/
|
||||
bool MightHaveOut() { return queue_out.MaybeReady(); }
|
||||
|
||||
/** Flags that the child process has finished processing. Called from child.
|
||||
/** Sends a message to the main thread signaling that the child process
|
||||
* has finished processing. Called from child.
|
||||
*/
|
||||
void Finished();
|
||||
|
||||
|
@ -299,7 +300,8 @@ private:
|
|||
uint64_t cnt_sent_in; // Counts message sent to child.
|
||||
uint64_t cnt_sent_out; // Counts message sent by child.
|
||||
|
||||
bool finished; // Set to true by Finished message.
|
||||
bool main_finished; // Main thread is finished, meaning child_finished propagated back through message queue.
|
||||
bool child_finished; // Child thread is finished.
|
||||
bool failed; // Set to true when a command failed.
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue