Skip to content

Readme should warn that a watch should be added on the same thread that will call update() #8

@n00bmind

Description

@n00bmind

Pretty much what the title says..
On Win32, you will not receive any callbacks unless addWatch() was called on the same thread that will later call update(). This is very non-obvious and I just spent a good chunk of time diving through the wonderful MSDN docs, until I stumbled upon this extremely easy to miss paragraph in the docs for WaitForMultipleEx:

A completion routine is queued when the ReadFileEx or WriteFileEx function in which it was specified has completed. The wait function returns and the completion routine is called only if bAlertable is TRUE and the calling thread is the thread that initiated the read or write operation. An APC is queued when you call QueueUserAPC.

Anyway, hope this post will at least help avoid frustration for other people in the future..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions