void EXPECT_CALLHttpServer() { EXPECT_CALL(m_HttpServer, AddReference()).WillRepeatedly(testing::Return(1)); EXPECT_CALL(m_HttpServer, ReleaseReference()).WillRepeatedly(testing::Return(1)); EXPECT_CALL(m_HttpServer, OpenWithSink(testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, Disconnect(testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, SendData(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, GetRequestHeader(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, SetOrAddResponseHeader(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, SetOption(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer, GetOption(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, AddReference()).WillRepeatedly(testing::Return(1)); EXPECT_CALL(m_HttpServer2, ReleaseReference()).WillRepeatedly(testing::Return(1)); EXPECT_CALL(m_HttpServer2, OpenWithSink(testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, Disconnect(testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, SendData(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, GetRequestHeader(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, SetOrAddResponseHeader(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, SetOption(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); EXPECT_CALL(m_HttpServer2, GetOption(testing::_, testing::_)).WillRepeatedly(testing::Return(CM_OK)); }
ECode CursorWindow::FreeLastRow() { AcquireReference(); //try { NativeFreeLastRow(); //} finally { ReleaseReference(); //} return NOERROR; }
Boolean CursorWindow::AllocRow() { AcquireReference(); //try { Boolean result = NativeAllocRow(); //} finally { ReleaseReference(); //} return result; }
Int32 CursorWindow::GetNumRows() { AcquireReference(); //try { Int32 num = NativeGetNumRows(); //} finally { ReleaseReference(); //} return num; }
ECode CursorWindow::Clear() { AcquireReference(); //try { mStartPos = 0; NativeClear(); //} finally { ReleaseReference(); //} return NOERROR; }
Boolean CursorWindow::SetNumColumns( /* [in] */ Int32 columnNum) { AcquireReference(); //try { Boolean result = NativeSetNumColumns(columnNum); //} finally { ReleaseReference(); //} return result; }
Boolean CursorWindow::IsNull( /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean isNull = NativeIsNull(row - mStartPos, col); //} finally { ReleaseReference(); //} return isNull; }
Boolean CursorWindow::PutNull( /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean result = NativePutNull(row - mStartPos, col); //} finally { ReleaseReference(); //} return result; }
Boolean CursorWindow::PutBlob( /* [in] */ const ArrayOf<Byte> & value, /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean result = NativePutBlob(value, row - mStartPos, col); //} finally { ReleaseReference(); //} return result; }
ECode CursorWindow::GetDouble( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Double* value) { AcquireReference(); //try { ECode ec = NativeGetDouble(row - mStartPos, col, value); //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetString( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ String* str) { AcquireReference(); //try { ECode ec = NativeGetString(row - mStartPos, col, str); //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::IsString( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Boolean* isString) { AcquireReference(); //try { ECode ec = NativeIsString(row - mStartPos, col, isString); //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetBlob( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ ArrayOf<Byte>** blob) { AcquireReference(); //try { ECode ec = NativeGetBlob(row - mStartPos, col, blob); //} finally { ReleaseReference(); //} return ec; }
void CreateThreadEvent::DoDPC(DPCQueue* queue) { // We're no longer queued in the DPC queue, so we can be reused. atomic_set(&fPendingDPC, 0); // create the thread thread_id threadID = thread_create_thread(fCreationAttributes, false); if (threadID >= 0) resume_thread(threadID); ReleaseReference(); }
ECode CursorWindow::GetInt32( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Int32* value) { AcquireReference(); //try { Int64 i64Value; ECode ec = NativeGetInt64(row - mStartPos, col, &i64Value); *value = (Int32)i64Value; //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetFloat( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Float* value) { AcquireReference(); //try { Double dValue; ECode ec = NativeGetDouble(row - mStartPos, col, &dValue); *value = dValue; //} finally { ReleaseReference(); //} return ec; }
void net_socket_private::RemoveFromParent() { ASSERT(!is_in_socket_list && parent != NULL); parent = NULL; mutex_lock(&sSocketLock); sSocketList.Add(this); mutex_unlock(&sSocketLock); is_in_socket_list = true; ReleaseReference(); }
void UnixEndpoint::Uninit() { TRACE("[%ld] %p->UnixEndpoint::Uninit()\n", find_thread(NULL), this); // check whether we're closed UnixEndpointLocker locker(this); bool closed = (fState == UNIX_ENDPOINT_CLOSED); locker.Unlock(); if (!closed) { // That probably means, we're a child endpoint of a listener and // have been fully connected, but not yet accepted. Our Close() // hook isn't called in this case. Do it manually. Close(); } ReleaseReference(); }
void TeamSignalEvent::DoDPC(DPCQueue* queue) { fSignal->AcquireReference(); // one reference is transferred to send_signal_to_team_locked InterruptsSpinLocker locker(fTeam->signal_lock); status_t error = send_signal_to_team_locked(fTeam, fSignal->Number(), fSignal, B_DO_NOT_RESCHEDULE); locker.Unlock(); // There are situations (for certain signals), in which // send_signal_to_team_locked() succeeds without queuing the signal. if (error != B_OK || !fSignal->IsPending()) fSignal->SetUnused(); // We're no longer queued in the DPC queue, so we can be reused. atomic_set(&fPendingDPC, 0); ReleaseReference(); }
void SystemProfiler::EventOccurred(NotificationService& service, const KMessage* event) { int32 eventCode; if (event->FindInt32("event", &eventCode) != B_OK) return; if (strcmp(service.Name(), "teams") == 0) { Team* team = (Team*)event->GetPointer("teamStruct", NULL); if (team == NULL) return; switch (eventCode) { case TEAM_ADDED: if (fTeamNotificationsEnabled) _TeamAdded(team); break; case TEAM_REMOVED: if (team->id == fTeam) { // The profiling team is gone -- uninstall the profiler! InterruptsSpinLocker locker(sProfilerLock); if (sProfiler != this) return; sProfiler = NULL; locker.Unlock(); ReleaseReference(); return; } // When we're still doing the initial team list scan, we are // also interested in removals that happened to teams we have // already seen. if (fTeamNotificationsEnabled || team->serial_number <= fLastTeamAddedSerialNumber) { _TeamRemoved(team); } break; case TEAM_EXEC: if (fTeamNotificationsEnabled) _TeamExec(team); break; } } else if (strcmp(service.Name(), "threads") == 0) { Thread* thread = (Thread*)event->GetPointer("threadStruct", NULL); if (thread == NULL) return; switch (eventCode) { case THREAD_ADDED: if (fThreadNotificationsEnabled) _ThreadAdded(thread); break; case THREAD_REMOVED: // When we're still doing the initial thread list scan, we are // also interested in removals that happened to threads we have // already seen. if (fThreadNotificationsEnabled || thread->serial_number <= fLastThreadAddedSerialNumber) { _ThreadRemoved(thread); } break; } } else if (strcmp(service.Name(), "images") == 0) { if (!fImageNotificationsEnabled) return; struct image* image = (struct image*)event->GetPointer( "imageStruct", NULL); if (image == NULL) return; switch (eventCode) { case IMAGE_ADDED: _ImageAdded(image); break; case IMAGE_REMOVED: _ImageRemoved(image); break; } } else if (strcmp(service.Name(), "I/O") == 0) { if (!fIONotificationsEnabled) return; IOScheduler* scheduler = (IOScheduler*)event->GetPointer("scheduler", NULL); if (scheduler == NULL) return; IORequest* request = (IORequest*)event->GetPointer("request", NULL); IOOperation* operation = (IOOperation*)event->GetPointer("operation", NULL); switch (eventCode) { case IO_SCHEDULER_ADDED: _IOSchedulerAdded(scheduler); break; case IO_SCHEDULER_REMOVED: _IOSchedulerRemoved(scheduler); break; case IO_SCHEDULER_REQUEST_SCHEDULED: _IORequestScheduled(scheduler, request); break; case IO_SCHEDULER_REQUEST_FINISHED: _IORequestFinished(scheduler, request); break; case IO_SCHEDULER_OPERATION_STARTED: _IOOperationStarted(scheduler, request, operation); break; case IO_SCHEDULER_OPERATION_FINISHED: _IOOperationFinished(scheduler, request, operation); break; } } _MaybeNotifyProfilerThread(); }
void EXPECT_CALLHTTPExProtoHandle() { EXPECT_CALL(m_HTTPExHandle, AddReference()).WillRepeatedly(testing::Return(1)); EXPECT_CALL(m_HTTPExHandle, ReleaseReference()).WillRepeatedly(testing::Return(1)); }
ECode CursorWindow::Close() { ReleaseReference(); return NOERROR; }