Opened 6 years ago

Closed 5 years ago

#8288 closed Feature Requests (invalid)

discrepancy between boost::asio::detail::posix_mutex and boost::asio::detail::win_mutex

Reported by: Spindizzy_Wizard@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

The Windows mutex implementation uses CRITICAL_SECTION, which is recursive. That is, if the same thread locks the same mutex twice, it will work.

The Linux mutex implementation via pthreads uses the default mutex settings, which are not recursive. A thread that locks the same mutex twice will deadlock.

I am suggesting that the pthreads implementation should use the recursive mutex settings so that you get the same behavior in both Windows and Linux.

Change History (1)

comment:1 Changed 5 years ago by chris_kohlhoff

Resolution: invalid
Status: newclosed

As a portable typedef, asio::detail::mutex is not intended to support recursive use.

Note: See TracTickets for help on using tickets.