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?
program
{TCondv}
constructor TCondv.Create;
begin
pthread_condattr_init(CAttr);
pthread_cond_init(Cond, CAttr);
end;
I never used pthreads, but looking at the constructor of TCondv, it seems to
require CAttr and
Conv to be setted before calling pthread_condattr_init and pthread_cond_init.
No, pthread_condattr_init and pthread_cond_init initialize variables CAttr
and Cond. By the by, this code written in C work right.
2007/5/7, Leonardo M. Ramé [EMAIL PROTECTED]:
{TCondv}
constructor TCondv.Create;
begin
pthread_condattr_init(CAttr);
pthread_cond_init(Cond, CAttr);
Can this error caused by wrong work of fpc compiler or linker?
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
Артем Смирнов wrote:
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
fpc 2.0.4, opensuse 10.2, glibc-2.4-31.1
2007/5/7, Bram Kuijvenhoven [EMAIL PROTECTED]:
Артем Смирнов wrote:
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
fpc 2.0.4, opensuse 10.2, glibc-2.4-31.1
You may try this version of your program
-
program Project1;
{$mode objfpc}{$H+}
uses
UnixType,pthreads;
type
TCondv = class
private
Cond : UnixType.pthread_cond_t;
CAttr : UnixType.pthread_condattr_t;
public
constructor Create;
I wonder if this might be a useful read to the architects here.
http://weblogs.mozillazine.org/roc/archives/2007/04/history_based_s.html
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel