[futurebasic] Re: Do handles to resources need to be locked?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1998 : Group Archive : Group : All Groups

From: Mars Saxman <marssaxman@...>
Date: Mon, 26 Jan 98 14:46:49 -0800
>  I was looking over some code in my program and all of a sudden I got
>nervous. The following bit of code works, but should I be locking resHand&
>before copying data from it? 

No. BlockMove does not move memory, and neither does Peek. Locking the 
handle won't hurt anything, but it simply isn't necessary in this 
fragment.

In general terms, it *is* a good idea to lock a handle before doing 
anything "serious" with it. BlockMove, however, is a special case.

-Mars