Revision: 7222
http://playerstage.svn.sourceforge.net/playerstage/?rev=7222&view=rev
Author: thjc
Date: 2009-01-02 20:56:14 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
change register function to have correct case for eedhcontroller, fixed its
shutdown/mainquit method for threaded driver, changed main loop to wait for
messages
Modified Paths:
--------------
code/player/trunk/server/drivers/limb/eeDHcontroller.cc
Modified: code/player/trunk/server/drivers/limb/eeDHcontroller.cc
===================================================================
--- code/player/trunk/server/drivers/limb/eeDHcontroller.cc 2009-01-02
20:42:04 UTC (rev 7221)
+++ code/player/trunk/server/drivers/limb/eeDHcontroller.cc 2009-01-02
20:56:14 UTC (rev 7222)
@@ -145,7 +145,7 @@
// Implementations of virtual functions
virtual int MainSetup ();
- virtual int Shutdown ();
+ virtual void MainQuit ();
// This method will be invoked on each incoming message
virtual int ProcessMessage (QueuePointer &resp_queue,
@@ -215,7 +215,7 @@
// Registers the driver in the driver table. Called from the
// player_driver_init function that the loader looks for
void
- EEDHController_Register (DriverTable* table)
+ eedhcontroller_Register (DriverTable* table)
{
table->AddDriver ("eeDHcontroller", EEDHController_Init);
}
@@ -309,19 +309,15 @@
////////////////////////////////////////////////////////////////////////////////
// Shutdown the device
-int
- EEDHController::Shutdown ()
+void
+ EEDHController::MainQuit ()
{
- // Stop the driver thread
- StopThread ();
-
pthread_cancel (a_th_cmd);
pthread_cancel (a_th_home);
this->actarray_device->Unsubscribe (this->InQueue);
PLAYER_MSG0 (1, "> EEDHController driver shutting down... [done]");
- return (0);
}
@@ -330,23 +326,18 @@
void
EEDHController::Main ()
{
- timespec sleepTime = {0, 1000};
-
command_thread = homing_thread = false;
// The main loop; interact with the device here
while (true)
{
- // test if we are supposed to cancel
- pthread_testcancel ();
+ Wait();
// Process any pending messages
this->ProcessMessages ();
// Refresh data
this->RefreshData ();
-
- nanosleep (&sleepTime, NULL);
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit