status_t WPASupplicantApp::_EnqueueAndNotify(BMessage *message) { if (!fEventQueue.Lock()) return B_ERROR; fEventQueue.AddMessage(message); fEventQueue.Unlock(); return _NotifyEventLoop(); }
/*! \brief Adds an IsAppRegistered() request to the given map. If something goes wrong, the method deletes the request. \param map The map the request shall be added to. \param key The key under which to add the request. \param request The request message to be added. */ void TRoster::_AddIARRequest(IARRequestMap& map, int32 key, BMessage* request) { IARRequestMap::iterator it = map.find(key); BMessageQueue* requests = NULL; if (it == map.end()) { requests = new(nothrow) BMessageQueue(); if (!requests) { delete request; return; } map[key] = requests; } else requests = it->second; requests->AddMessage(request); }