|
From: CVS C. to T. <the...@li...> - 2019-04-07 02:07:03
|
Revision: 744
http://sourceforge.net/p/themis/code/744
Author: mark_hellegers
Date: 2019-04-07 02:07:01 +0000 (Sun, 07 Apr 2019)
Log Message:
-----------
Wait for the looper thread to die. Got broken with my rewrite some time back. Added the code back with a comment, so I won't forget.
Also added code to start the looper if a plugin is a looper, so the plugin does not have to do this itself.
Modified Paths:
--------------
trunk/themis/common/plugman.cpp
Modified: trunk/themis/common/plugman.cpp
===================================================================
--- trunk/themis/common/plugman.cpp 2019-03-31 17:06:28 UTC (rev 743)
+++ trunk/themis/common/plugman.cpp 2019-04-07 02:07:01 UTC (rev 744)
@@ -186,6 +186,9 @@
if (plugin->IsHandler()) {
AddHandler(plugin->Handler());
}
+ else if (plugin->IsLooper()) {
+ plugin->Looper()->Run();
+ }
printf("Succesfully got object %s\n", plugin->PlugName());
}
@@ -234,9 +237,15 @@
}
else if (aPlugin->IsLooper()) {
+ thread_id plugin_thread_id = aPlugin->Looper()->Thread();
+ status_t thread_status;
BMessenger messenger(NULL, aPlugin->Looper());
// Use a synchronous message to quit. Don't care about the result?
messenger.SendMessage(&quitMessage, &replyMessage);
+ // Wait for the thread to stop. We only requested the looper to stop.
+ // Does not mean it has already stopped.
+ // We cannot unload the addon until this is done.
+ wait_for_thread(plugin_thread_id, &thread_status);
}
else {
status_t (*Shutdown)(bool);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|