[Gambas-devel] Question about singleton class

Tobias Boege taboege at ...176...
Sat Sep 13 21:40:02 CEST 2014


On Sat, 13 Sep 2014, Tobias Boege wrote:
> It is the same situation as assigning "h = Null". Do you think this should
> keep the lock open, too? If you do, there is one thing you can do about it.
> You can define your very personal lock class which will never close the
> accompanying fd, even if the lock object is destroyed. The only way you
> would close the fd is by an invocation of the Unlock instruction. Your last
> question below sort of goes into this direction, but you can't implement
> Lock and Unlock handlers in Gambas classes, so you would provide respective
> Lock()/Unlock() methods from your class or write your own native component.
> 

Or an even better way would be to add a static "Locks" class. This acts like
an array for all your locks, so they are always referenced and never closed.

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the Devel mailing list