Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Thread lock with MinGW and a JVM  #340

Copy link
Copy link
Closed
@aaron-bray

Description

@aaron-bray
Issue body actions

The ThreadPool deconstruction hangs on 'condition_consumers.notify_all();'

I am using log4cplus as part of my C++ library.
I have JNI bindings to provide usage of my library through Java
The Java app does a load library for linkage with my C++ app
When the Java app finishes, and deconstructs everything, the jvm hangs and will not exit
If I comment out the condition_consumers.notify_all(); line, everything deconstructs and the jvm exits
This only occurs when I build log4cplus on windows 10 using mingw-64
(msvc 2015,2017, osx clang, ubuntu gcc all deconstruct fine)

I have not had any issues with native C++ applications built with mingw hanging at program deconstruction, but I will confirm this and ensure the ThreadPool dtor does indeed complete. (I assume it will, and this is some weird JVM/mingw thread disagreement)

To reproduce this,

I pulled 5ce831b
Using cmake 3.8.1, I turned off WITH_UNIT_TESTS, LOGGINGSERVER, TESTING, DECORATION
I built the log4cplus.dll using mingw-64 version 8.1 and 7.3 from the latest mingw-w64 download from sourceforge
I then run this simple Java (Java x64 1.8.0_131) program:

package kitware.physiology.pulse;

public class QuickLoad 
{
  public static void main(String[] args) 
  {
    System.load("C:/Programming/builds/log4cplus-mingw7/bin/liblog4cplus.dll");
    //System.load("C:/Programming/builds/log4cplus-mingw8/bin/liblog4cplus.dll");
    System.out.println("I am done!");
  }
}

I am running this simple driver via eclipse neon, and the jvm never exits
I am not calling the initialize logger or anything, just loading the dll and exiting

This is on my Surface Pro 3, x64,
(Note other users have reported this, not sure about their platform other than mingw on windows 7)

Metadata

Metadata

Assignees

Labels

de-/initializationissues dealing with initialization or deinitializationissues dealing with initialization or deinitialization

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.