93 class TGWin32CallBackObject :
public TObject {
98 TGWin32CallBackObject(
TGWin32CallBack cb,
void *p):fCallBack(cb),fParam(p) {}
99 ~TGWin32CallBackObject() {
if (fParam)
delete fParam; }
103 class TGWin32ProxyBasePrivate {
106 TGWin32ProxyBasePrivate();
107 ~TGWin32ProxyBasePrivate();
113 TGWin32ProxyBasePrivate::TGWin32ProxyBasePrivate()
115 fEvent = ::CreateEvent(
NULL, TRUE, FALSE,
NULL);
121 TGWin32ProxyBasePrivate::~TGWin32ProxyBasePrivate()
123 if (fEvent) ::CloseHandle(fEvent);
128 ULong_t TGWin32ProxyBase::fgPostMessageId = 0;
129 ULong_t TGWin32ProxyBase::fgPingMessageId = 0;
130 ULong_t TGWin32ProxyBase::fgMainThreadId = 0;
131 ULong_t TGWin32ProxyBase::fgUserThreadId = 0;
132 Long_t TGWin32ProxyBase::fgLock = 0;
133 UInt_t TGWin32ProxyBase::fMaxResponseTime = 0;
146 fId = ::GetCurrentThreadId();
147 fPimpl =
new TGWin32ProxyBasePrivate();
187 ::InterlockedIncrement(&
fgLock);
196 ::InterlockedDecrement(&
fgLock);
212 static LARGE_INTEGER freq;
218 LARGE_INTEGER count0;
219 ::QueryPerformanceFrequency(&freq);
220 ::QueryPerformanceCounter(&count0);
223 dummy = ((
Double_t)count0.QuadPart - overhead)*1000./((
Double_t)freq.QuadPart);
225 ::QueryPerformanceCounter(&count);
230 ::QueryPerformanceCounter(&count);
231 return ((
Double_t)count.QuadPart - overhead)*1000./((
Double_t)freq.QuadPart);
243 TGWin32CallBackObject *
obj;
245 while ((obj = (TGWin32CallBackObject*)
next())) {
246 obj->fCallBack(obj->fParam);
251 ::SetEvent(
fPimpl->fEvent);
273 #ifdef OLD_THREAD_IMPLEMENTATION
298 if (wait++ > 5)
return kFALSE;
301 #ifdef OLD_THREAD_IMPLEMENTATION
305 DWORD res = WAIT_TIMEOUT;
306 while (res == WAIT_TIMEOUT) {
307 res = ::WaitForSingleObject(
fPimpl->fEvent, 100);
308 #ifdef OLD_THREAD_IMPLEMENTATION
313 if (cnt++ > 20)
break;
316 ::ResetEvent(
fPimpl->fEvent);
318 if (res == WAIT_TIMEOUT) {
virtual void ExecuteCallBack(Bool_t sync)
Executes all batched callbacks and the latest callback This method is executed by server thread...
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TGWin32CallBack fCallBack
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
static void GlobalUnlock()
unlock any proxy (client thread)
RooArgList L(const RooAbsArg &v1)
virtual ~TGWin32ProxyBase()
dtor
static void Lock()
enter critical section
virtual void SendExitMessage()
send exit message to server thread
static void GlobalLock()
lock any proxy (client thread)
static ULong_t fgMainThreadId
static ULong_t fgPostMessageId
static ULong_t fgUserThreadId
virtual Int_t GetSize() const
static RooMathCoreReg dummy
TGWin32ProxyBasePrivate * fPimpl
virtual Bool_t ForwardCallBack(Bool_t sync)
if sync is kTRUE:
static ULong_t fgPingMessageId
Mother of all ROOT objects.
static Bool_t IsGloballyLocked()
Check the status of the lock.
virtual void Add(TObject *obj)
virtual Double_t GetMilliSeconds()
returns elapsed time in milliseconds with microseconds precision
static Bool_t Ping()
send ping messsage to server thread
static void Unlock()
leave critical section
void(* TGWin32CallBack)(void *)