#167 Enable Mutex on Windows

0.60
closed
nobody
None
5
2016-12-11
2011-05-16
No

When compiling on Windows without Posix mutexes, the Mutex lock/unlock methods do nothing.

The Windows equivalent of the Posix mutex is the critical section, and this patch uses this to implement the lock/unlock methods.

Discussion

  • Kevin Atkinson

    Kevin Atkinson - 2011-05-18

    Thanks. It would be really helpful if you could attach a real patch file like you did for the more recent reports. Please do it in this report. If for some reason you don't have permission to delete the old file I will.

     
  • Stephen J. Muir

    Stephen J. Muir - 2011-05-18

    Replaced source with patch as requested.

     
  • Kevin Atkinson

    Kevin Atkinson - 2011-05-18

    Thanks, I can see the changes more clearly now.

    Is there a reason you do not what to include "Windows.h" in the "lock.hpp" header file? Is this some huge file which will not normally be included in a windows program?

     
  • Stephen J. Muir

    Stephen J. Muir - 2011-05-18

    I couldn't get it to build with Windows.h in the header file because the compiler complains about duplicate definitiions between acommon::IOStream and Windows IOStream. It somehow thought that the Windows IOStream was in the acommon namespace even though I placed it before the namespace declaration.

    I manually checked the pre-processed only .i file and came to the conclusion that it's a compiler bug because the .i file looked ok.

     
  • Kevin Atkinson

    Kevin Atkinson - 2016-12-11
    • Status: open --> closed