Skip to content

TacyLockable with pthread mutexes #965

@CBtiger

Description

@CBtiger

I am getting compile errors when tryping to use the TacyLockable() macro
with pthread mutexes in two scenarios with gcc on Linux:

  1. as class member
 class Test {
  ...
  public: 
     pthread_mutex_t       MyMutex;                            // before: ok
     TracyLockable(  pthread_mutex_t,  MyMutex );       // error
  };

Errors

MyMutex has not beed declared
expected constructor, destructor or type conversion before ';' token
  1. with "extern"
header: 
 extern pthread_mutex_t       MyMutex;    

CPP 
  pthread_mutex_t       MyMutex = PTHREAD_MUTEX_INITIALIZER;    // OK
  TracyLockable(  pthread_mutex_t,  MyMutex );                                // error, how to initialize?

Errors

conflicting declaratoion with header file line

Is there a way to deal with these two settings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions