// Static member definition:
PIRDeviceCollection PIRKeysetMetaData::controlledDevices;
+// Thread synchronization stuff:
+extern bool commandInFlight;
+
PIRKeysetMetaData::PIRKeysetMetaData(
const char *r,
PIRMakeName m,
{
}
+
+PIRKeysetMetaData::~PIRKeysetMetaData()
+{
+ clearProtocol();
+}
+
+
bool PIRKeysetMetaData::hasKey(
PIRKeyName name) const
{
}
-void PIRKeysetMetaData::clearProtocol()
+bool PIRKeysetMetaData::clearProtocol()
{
- if (threadableProtocol)
+ if (!threadableProtocol)
+ {
+ return true;
+ }
+ else if (!commandInFlight)
{
delete threadableProtocol;
threadableProtocol = 0;
+ return true;
}
+
+ return false;
}