Home Help Center

Problem with IceUtil::Mutex

anhpntanhpnt Member Tuan AnhOrganization: HUTProject: Webbot
I have a problem with IceUtil::Mutex. The method lock() thows ThreadSyscallException(). Going inside the method, I found that pthread_mutex_lock(&_mutex) returns error code 22.
It happens when my program have been executed for a while. My use of mutex is so simple that I can't figure out what is wrong. Please help me!

Regards,
Anhpnt

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Which platform/Ice version do you use?

    On supported platforms, this error typically indicates a memory management problem: you're trying to lock a mutex which has been destroyed.

    Cheers,
    Benoit.
  • anhpntanhpnt Member Tuan AnhOrganization: HUTProject: Webbot
    I'm sorry, I don't know how to get os and Ice current version?
    My mutex variable is global. How can it be destroyed?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    You can find the Ice version you're using by checking the ICE_STRING_VERSION macro in the "IceUtil/Config.h" header file. On Unix platforms, "uname -a" should tell you which operating system you're using.

    Without more information on your application, it's difficult to say what could be the cause of this exception... a memory management problem is often the cause of this error but it could also be something else. Can you perhaps reproduce it with a small test case that you post here?

    Cheers,
    Benoit.
Sign In or Register to comment.