🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14320

TThreads & winapi critical section calls

#14320
From: CC
Date: Fri, 15 Aug 2003 22:26
23 lines
1537 bytes
Greetings all;

I was wondering if within a TTHread,
is it ok to use the winapi:
  EnterCriticalSection();
  LeaveCriticalSection();
  InitializeCriticalSection();

Calls?

I have a tthread program, which I suspect is having problems somewhere with
multiple threads running non-thread safe code.

I wanted to do something like:
EnterCriticalSection(...);
// read a file here, read from socket, close file, etc
LeaveCriticalSection();

I would imaging the synchronize uses these calls.
The problems w/synchronize you cant pass arguments, etc to sync. function.

Thanks for the help.
CurtC
Technical Details
Message-ID: <3f3d5dfa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,455292b256c8f5c8,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-15 15:42:10 PST
From: "CC" <Xcurtc@tmscorp.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: TThreads & winapi critical section calls
Date: Fri, 15 Aug 2003 17:26:44 -0500
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 208.254.250.201
Message-ID: <3f3d5dfa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060986362 208.254.250.201 (15 Aug 2003 15:26:02 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail