jmolloy / pedigree

Pedigree operating system
http://pedigree.googlecode.com
ISC License
89 stars 5 forks source link

TimeoutGuard Breakpoint in ~TimeoutGuard #4

Closed miselin closed 15 years ago

miselin commented 15 years ago

TimeoutGuard's destructor calls Thread::cullEvent if the event did not fire when it goes out of scope.

However, cullEvent currently has a FATAL("cullEvent"); line in it, making it impossible to use TimeoutGuard properly. I'm not sure why it has this line, but I assume there's a good reason.

Failing code: Semaphore sem(0);

{
    TimeoutGuard guard(5);
    if (!guard.timedOut())
        NOTICE("Acquired sem");
}

NOTICE("Ended!");
for(;;);

If the semaphore acquire is not commented the timeout occurs as per normal, and there is no breakpoint.

jmolloy commented 15 years ago

Fatal removed, no reason for it being there (test code).