I've got some troubles with pthread_cond_init when calling it in class members. After this action next calling of class constructor for second object bring to SIGSEGV. When I tried to use Object instead Class all seems fine, but for my task Object not approach. What it can be?
<br><br>program pthcondtest;<br><br>{$mode objfpc}{$H+}<br><br>uses<br> pthreads;<br><br>type<br><br>TCondv = class<br> CAttr : pthread_condattr_t;<br> Cond : pthread_cond_t;<br>public<br> constructor Create;<br> destructor Destroy; override;
<br>end;<br><br>{TCondv}<br>constructor TCondv.Create;<br>begin<br> pthread_condattr_init(CAttr);<br> pthread_cond_init(Cond, CAttr);<br>end;<br><br><br>destructor TCondv.Destroy;<br>begin<br> inherited;<br> pthread_cond_destroy(Cond);
<br> pthread_condattr_destroy(CAttr);<br>end;<br>{TCondv}<br><br>var<br> obj1 : TCondv;<br> obj2 : TCondv;<br>begin<br> obj1 := TCondv.Create;<br> obj2 := TCondv.Create;<br> obj1.Destroy;<br> obj2.Destroy;<br>end.<br>
<br>