L3DT users' community
Large 3D terrain generator

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

Correspondence concerning plugins and scripts; development, use, bugs and ideas.

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

Postby jack.dingler » Sat Nov 25, 2006 10:48 pm

I'm getting this error when trying to builid the AtGrowTilesByOne demo and the Zeolite API Version 1.6
jack.dingler
Contributing member
 
Posts: 36
Joined: Mon Oct 09, 2006 2:58 am

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

Postby jack.dingler » Sat Nov 25, 2006 11:14 pm

I stubbed in a flag and it builds fine.

Does this serve a purpose? Or is it deprecated?
jack.dingler
Contributing member
 
Posts: 36
Joined: Mon Oct 09, 2006 2:58 am

Postby Aaron » Sun Nov 26, 2006 5:27 am

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.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby jack.dingler » Sun Nov 26, 2006 6:30 am

I thought as much.

I'm not making this first plugin multithreaded, so I suppose this doesn't effect my efforts.
jack.dingler
Contributing member
 
Posts: 36
Joined: Mon Oct 09, 2006 2:58 am

Postby Aaron » Mon Nov 27, 2006 1:04 am

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.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby jack.dingler » Mon Nov 27, 2006 2:18 am

I'll be happy to follow that convention when you release 1.7. :)
jack.dingler
Contributing member
 
Posts: 36
Joined: Mon Oct 09, 2006 2:58 am


Return to Plugins and scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron