🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: threads and critical sections

#779
From: danzer
Date: Wed, 09 Jan 2008 14:23
17 lines
1428 bytes
mataus wrote:
> Hello all - and good new year.
> 
> I have a question about threads and Critical Sections.  I need my main 
> thread to tell another thread of some state change.  This is shows with an 
> integer or boolean in the second thread.  Must i use Critical Section when 
> updating or is it safe to change an integer value?
> 
> Many thanks
> 
> mataus 
> 
> 

Use the API functions InterlockedIncrement and InterlockedDecrement.

Danzer
Technical Details
Message-ID: <4784d954$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4784d07b@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5d08ceba3672bae6
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 09 Jan 2008 08:23:34 -0600
From: danzer <.>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: threads and critical sections
References: <4784d07b@newsgroups.borland.com>
In-Reply-To: <4784d07b@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.96.229.17
Message-ID: <4784d954$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1199888724 24.96.229.17 (9 Jan 2008 06:25:24 -0700)
Lines: 17
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail