No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi all now, for testing modified codes, i encounter a problem. please consider the following code: [code=delphi] procedure MyThreadNum5(Data: Pointer) var i:integer; begin 1 lockvar.BeginRead; 2 try 3 i:=NumOfRxData; 4 finally 5 lockvar.EndRead; 6 end; .... end; [/code] the above thread freezes on line #1; while in the main vcl … | |
in the borland delphi help 2006 : Note that a write lock operation is not atomic. Data in protected memory will always be in a consistent state when BeginWrite returns, but is not necessarily in the same state as when BeginWrite was called. As a rule, a thread should always … |