Open Bug 1524072 Opened 5 years ago Updated 10 months ago

remove chromium's WaitableEvent code

Categories

(Core :: IPC, enhancement, P1)

enhancement

Tracking

()

People

(Reporter: froydnj, Unassigned)

References

Details

Attachments

(4 files)

See the commit message for part 4 for why this seems like a reasonable thing to do.

There's no need for subclasses to be twiddling this variable, and it
makes our life easier in the next patch.
Attachment #9040236 - Flags: review?(jld)
This patch is complicated, but that's mostly because waiting for condition
variables on timeouts is complicated if you want to be robust about it.

This patch is also *possible* justification for keeping WaitableEvent, as the
code with WaitableEvent is significantly nicer, but I think we're better off
without WaitableEvent (and the Chromium lock code, see part 4).
Attachment #9040240 - Flags: review?(jld)
Longer than using WaitableEvent, but less magical.
Attachment #9040241 - Flags: review?(jld)
Chromium's WaitableEvent is, on Windows, a thin wrapper around Windows
event objects.  On POSIX systems, it's something rather more
complicated.  The primary advantages of it seem to be twofold:

1. You can wait on multiple events with ease.
2. It's shorter than using a monitor + boolean variable.

The latter capability is not used in our codebase (and seems to only be
rarely used in Chromium's present codebase).  The latter advantage is
certainly true, but the implementation of WaitableEvent on POSIX systems
is complicated enough (and involves things like careful manipulation of
lock acquisition/release in non-LIFO order) that it seems reasonable to
just write out the monitor/boolean logic in the two places we use
WaitableEvent.  Previous patches have done just that, and this patch
removes the now-unused WaitableEvent code.

(Doing this also means that it's significantly easier to get rid of the
Chromium lock code, as the POSIX WaitableEvent implementation was the
last client of the Chromium lock code.  Replacing the Chromium locks
there with mozilla::Mutex was complicated by the aforementioned non-LIFO
lock manipulation, as the deadlock detector was quite unhappy about said
non-LIFO shenanigans.)
Attachment #9040242 - Flags: review?(jld)
Priority: -- → P1
Attachment #9040236 - Flags: review?(jld) → review+
Attachment #9040240 - Flags: review?(jld) → review+
Attachment #9040241 - Flags: review?(jld) → review+
Attachment #9040242 - Flags: review?(jld) → review+

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:froydnj, could you have a look please?

Flags: needinfo?(nfroyd)
Flags: needinfo?(nfroyd)
Assignee: froydnj+bz → nobody
No longer blocks: 1062533
See Also: → 1062533
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: