BlitzThreads (Windows only)

Miscellaneous Forums/Blitz Showcase/BlitzThreads (Windows only)


I got a request if thats ok.

IsThreadActive:Boolean()

My thoughts are like this.

initgame()
thread -> loadmedia()
repeat
until IsThreadActive()=false
Playegame()



The 'next' version will spawn threads within a carrier function to allow this. Sadly winAPI doesn't(or at least msdn doesn't document it) have any functions to just check if a thread is running.

In the mean time, remember threads have the SAME scope as the function would if you called it normally.

So for now,

global MediaLoading = true
function LoadMedia:Int(bb_func:Byte ptr )
  'load media
  MediaLoading = false
end function

CreateThreaad( LoadMedia)

while MediaLoading
wend 'wait for media to finish loading.

---

it is win32 only?



Is it planned to make this work crossplatform;MacOs,Linux?



Win32 for now, mac/Linux versions to come. It will be totally abstracted, so anycode you write in the windows version will eventually work without alteration on other platforms, basically..
---
Btw, never mentioned it before, but if you guys find any bugs, please report them.

Ant.

And on the next version of Arrested Threads, Jobe smuggles himself out of prison and into solitary. "I've made a huge mistake"