Article View: borland.public.cppbuilder.database.multi-tier
Article #828critical section on application server
From: Jeroen Eikmans
Date: Thu, 09 Nov 2000 00:00
Date: Thu, 09 Nov 2000 00:00
39 lines
1454 bytes
1454 bytes
hello all,
I have an application server. Each time a client connects to it i want to
increment a counter
on my main form. Because the main form is in a different thread, i figured i
should use a instance of TCriticalSection. Am I doing this right ?:
TCriticalSection* GMainGuard;
void __fastcall TBMSApplicationServer::CRemoteDataModuleCreate(
TObject *Sender)
{
// client connect
// enter the critical section of the global main form
GMainGuard->Enter();
try {
BMSServerForm->UpdateClients(1);
}
__finally {
// leave the critical section of the global main form
GMainGuard->Leave();
}
}
thanx,
--
Jeroen Eikmans - Software Engineering
Pulse Automation Experts bv
Marinus Dammeweg 66
5928PW VENLO
The Netherlands
office@pulse-experts.nl
+31 (0)77 - 323 26 26
+31 (0)77 - 323 26 27 fax
Visit our site: www.pulse-experts.nl
Technical Details
Message-ID:
<3a0a7357_2@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,7d5c41d5707e4f2a,start X-Google-Attributes: gidfcd2b,public From: "Jeroen Eikmans" <office@pulse-experts.nl> Subject: critical section on application server Date: 2000/11/09 Message-ID: <3a0a7357_2@dnews> X-Deja-AN: 691551212 X-Trace: 9 Nov 2000 01:50:15 -0800, 195.109.246.154 Organization: Pulse Automation Experts bv X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.cppbuilder.database.multi-tier X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700