Skip to content

BOOST_THREAD_HAS_EINTR_BUG behavior changed #275

@austin-beer

Description

@austin-beer

In 5b209c2, the code that uses BOOST_THREAD_HAS_EINTR_BUG was moved from pthread/mutex.hpp to pthread/pthread_mutex_scoped_lock.hpp. However, pthread/mutex.hpp includes pthread/pthread_mutex_scoped_lock.hpp before it defines BOOST_THREAD_HAS_EINTR_BUG. Therefore, the code in pthread/pthread_mutex_scoped_lock.hpp no longer sees that BOOST_THREAD_HAS_EINTR_BUG has been defined.

Old Behavior (Before 5b209c2): The fix for the EINTR bug is used unless the user defines BOOST_THREAD_HAS_NO_EINTR_BUG.

New Behavior (After 5b209c2): The fix for the EINTR bug is not used unless the user defines BOOST_THREAD_HAS_EINTR_BUG.

Which behavior do we want moving forward? If the old behavior is desired, then we need to move the following three lines from pthread/mutex.hpp to pthread/pthread_mutex_scoped_lock.hpp:

#ifndef BOOST_THREAD_HAS_NO_EINTR_BUG
#define BOOST_THREAD_HAS_EINTR_BUG
#endif

If the new behavior is desired, then we need to delete the above three lines from pthread/mutex.hpp since they no longer do anything and so are confusing.

I think the new behavior is preferred because very few POSIX implementations suffer from the EINTR bug, but there may be other factors that I'm not aware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions