Page 1 of 1

error C2039: 'SetBusyFlag' : is not a member of 'CzMap'

PostPosted: Sat Nov 25, 2006 10:48 pm
by jack.dingler
I'm getting this error when trying to builid the AtGrowTilesByOne demo and the Zeolite API Version 1.6

Re: error C2039: 'SetBusyFlag' : is not a member of 'CzMap'

PostPosted: Sat Nov 25, 2006 11:14 pm
by jack.dingler
I stubbed in a flag and it builds fine.

Does this serve a purpose? Or is it deprecated?

PostPosted: Sun Nov 26, 2006 5:27 am
by Aaron
Hi Jack,

Oops, the latest version of AtGrowTilesByOne was built against Zeolite 1.7, which I haven't released yet. SetBusyFlag is used for multithreaded calculations where one thread can to take control of a map during a calculation so that another thread doesn't do something silly like deallocate the memory. I'll release the updated API in a week or two.

Best regards,
Aaron.

PostPosted: Sun Nov 26, 2006 6:30 am
by jack.dingler
I thought as much.

I'm not making this first plugin multithreaded, so I suppose this doesn't effect my efforts.

PostPosted: Mon Nov 27, 2006 1:04 am
by Aaron
Hi Jack,

It will probably be necessary, or at least recommended, to set this flag when it's available in the next release. Even though your plugin may not be multithreaded, L3DT is, and other plugins may be, so you'll still need to protect 'your maps' from the actions of those other threads. Added to this, plugin menu functions will soon be wrapped in a worker thread (possibly optional, maybe default) so that the UI doesn't lock during calculations, in which case all plugins *should* use SetBusyFlag/GetBusyFlag to avoid thread collisions. The actual danger is not all that great unless the user clicks on something in the menu at the wrong time, but this does nonetheless occur, and the results can be very odd indeed, ranging from random map data corruption through to streams of error messages and up to general protection faults (yucky!). Appropriate use of SetBusyFlag will mean that the worst thing that could happen is an error message thrown to the event log, followed by a graceful exit from the calculation. Basically, the recommended usage is to call SetBusyFlag(true) in your high-level functions before starting any of the real calculations, and then calling SetBustFlag(false) on clean-up, whether or not an error occurred. This is how it's done in atGrowTilesByOne.

Cheers,
Aaron.

PostPosted: Mon Nov 27, 2006 2:18 am
by jack.dingler
I'll be happy to follow that convention when you release 1.7. :)