86 |
} |
} |
87 |
|
|
88 |
int EventThread::Main() { |
int EventThread::Main() { |
89 |
|
|
90 |
|
#if DEBUG |
91 |
|
Thread::setNameOfCaller("HostPlugin"); |
92 |
|
#endif |
93 |
|
|
94 |
for (;;) { |
for (;;) { |
95 |
TestCancel(); |
TestCancel(); |
96 |
sleep(1); |
sleep(1); |
97 |
|
|
98 |
|
// prevent thread from being cancelled |
99 |
|
// (e.g. to prevent deadlocks while holding mutex lock(s)) |
100 |
|
pushCancelable(false); |
101 |
|
|
102 |
pSampler->fireStatistics(); |
pSampler->fireStatistics(); |
103 |
|
|
104 |
|
// now allow thread being cancelled again |
105 |
|
// (since all mutexes are now unlocked) |
106 |
|
popCancelable(); |
107 |
} |
} |
108 |
return 0; |
return 0; |
109 |
} |
} |