зеркало из https://github.com/mozilla/gecko-dev.git
Refining the event loop for cocoa plevents. Not part of build.
This commit is contained in:
Родитель
4acba952bc
Коммит
fb3c11fe91
|
@ -130,7 +130,7 @@ printf("shutting down event queue\n");
|
||||||
// Called periodically to process PLEvents from the queue on the current thread
|
// Called periodically to process PLEvents from the queue on the current thread
|
||||||
//
|
//
|
||||||
|
|
||||||
#define LOOP_THRESHOLD 10
|
#define LOOP_THRESHOLD 20
|
||||||
|
|
||||||
- (void)eventTimer:(NSTimer *)theTimer
|
- (void)eventTimer:(NSTimer *)theTimer
|
||||||
{
|
{
|
||||||
|
@ -140,6 +140,10 @@ printf("shutting down event queue\n");
|
||||||
if (queue) {
|
if (queue) {
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
for (PRInt32 i = 0; i < LOOP_THRESHOLD; i++) {
|
for (PRInt32 i = 0; i < LOOP_THRESHOLD; i++) {
|
||||||
|
PRBool pendingEvents = PR_FALSE;
|
||||||
|
queue->PendingEvents(&pendingEvents);
|
||||||
|
if (!pendingEvents)
|
||||||
|
break;
|
||||||
queue->ProcessPendingEvents();
|
queue->ProcessPendingEvents();
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Error processing PLEvents");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Error processing PLEvents");
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче