MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / waitForType

Method waitForType

src/yvalve/PluginManager.cpp:1217–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1215}
1216
1217void PluginManager::waitForType(unsigned int typeThatMustGoAway)
1218{
1219 fb_assert(typeThatMustGoAway < PluginManager::TYPE_COUNT);
1220
1221 Semaphore sem;
1222 Semaphore* semPtr = NULL;
1223
1224 { // guard scope
1225 MutexLockGuard g(plugins->mutex, FB_FUNCTION);
1226
1227 if (byTypeCounters->get(typeThatMustGoAway).counter > 0)
1228 {
1229 fb_assert(!byTypeCounters->get(typeThatMustGoAway).waitsOn);
1230 byTypeCounters->get(typeThatMustGoAway).waitsOn = semPtr = &sem;
1231#ifdef DEBUG_PLUGINS
1232 fprintf(stderr, "PluginManager::waitForType %d\n", typeThatMustGoAway);
1233#endif
1234 }
1235#ifdef DEBUG_PLUGINS
1236 else
1237 {
1238 fprintf(stderr, "PluginManager: type %d is already gone\n", typeThatMustGoAway);
1239 }
1240#endif
1241 }
1242
1243 if (semPtr)
1244 {
1245 semPtr->enter();
1246 }
1247}
1248
1249void PluginManager::threadDetach()
1250{

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
enterMethod · 0.45

Tested by

no test coverage detected