Re: Problem with mutex.lock()

2019-02-15 Thread Banta Plan
Just to wrap this up. std::mutex behaves as it should. Still most of the other OSs implemented it in a diverent way. And just as a short help. If somebody really wants to deadlock himself, it can be done with std::condition_variables. ___ freebsd-to

Re: Problem with mutex.lock()

2019-02-11 Thread Konstantin Belousov
On Mon, Feb 11, 2019 at 02:04:38PM +, Banta Plan wrote: > I think you can reduce the problem to: > ## > int main() { > std::mutex m; > m.lock(); > m.lock(); > > return 0; > } > ## > > This should deadlock. Where is it specified that the program should deadlock ? The behaviour

Re: Problem with mutex.lock()

2019-02-11 Thread Bob Bishop
Hi, > On 11 Feb 2019, at 11:09, Banta Plan wrote: > > I compiled this program and it crashes if executed. > > Compiled with: FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) > (based on LLVM 6.0.1) > > ## CMakeLists.txt > cmake_minimum_required(VERSION 3.13) > project(mainP) > > s

Re: Problem with mutex.lock()

2019-02-11 Thread Konstantin Belousov
On Mon, Feb 11, 2019 at 11:09:29AM +, Banta Plan wrote: > I compiled this program and it crashes if executed. > > Compiled with: FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) > (based on LLVM 6.0.1) > > ## CMakeLists.txt > cmake_minimum_required(VERSION 3.13) > project(mainP) >