1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-03 13:15:46 +01:00

Allow plugins onUnload handlers, fix some threadYield issues.

This commit is contained in:
Kris Maglione
2008-12-01 15:08:50 +00:00
parent 855caac185
commit a2550499c8
7 changed files with 24 additions and 15 deletions

View File

@@ -566,13 +566,14 @@ function Events() //{{{
if (buffer.loaded == 1)
return true;
var ms = 25000; // maximum time to wait - TODO: add option
var then = new Date().getTime();
for (let now = then; now - then < ms; now = new Date().getTime())
let start = Date.now();
let end = start + 25000; // maximum time to wait - TODO: add option
let now;
while (now = Date.now(), now < end)
{
liberator.threadYield();
if ((now - then) % 1000 < 10)
liberator.dump("waited: " + (now - then) + " ms");
if ((now - start) % 1000 < 10)
liberator.dump("waited: " + (now - start) + " ms");
if (!events.feedingKeys)
return false;