ContextCli * CliGlobals::getContext(SQLCTX_HANDLE context_handle, NABoolean calledFromDrop) { ContextCli * context; cliSemaphore_->get(); contextList_->position((char*)&context_handle, sizeof(SQLCTX_HANDLE)); while ((context = (ContextCli *)contextList_->getNext()) != NULL) { if (context_handle == context->getContextHandle()) { if (context->isDropInProgress()) context = NULL; else if (calledFromDrop) context->setDropInProgress(); cliSemaphore_->release(); return context; } } cliSemaphore_->release(); return NULL; }