New topic: 

Control container threads

<http://forums.realsoftware.com/viewtopic.php?t=43879>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        Don76          Post subject: Control container threadsPosted: 
Fri May 04, 2012 2:44 pm                         
Joined: Thu May 03, 2012 3:21 pm
Posts: 1                I have done a ControlContainer with 2 threads and a 
common array. I need to use semaphore but it is not possible to declare Sema = 
new semaphore in a control container
Now I do this:
I created a common variable (Property) Sema as semaphore 
In a sub Open() I wrote:
Dim aaa = new semaphore
Sema = aaa

It works but is it correct ?

if the main thread (windows1) read my common array in control container, have I 
problem to share it? Or is it enough to create a semaphore also in a main 
thread ?

Thank you !   
                             Top                timhare          Post subject: 
Re: Control container threadsPosted: Fri May 04, 2012 5:31 pm                   
      
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11264
Location: Portland, OR  USA                Quote:it is not possible to declare 
Sema = new semaphore in a control container
You cannot put any executable code in a property declaration. 

Quote:Dim aaa = new semaphore
Sema = aaa
Or just

Sema = New Semaphore

No need for a temporary variable.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to