• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Snippet] Thread

That won't work because a leaving player may/may not have run a selection event (possible early fire)

Also, the leaving player may be the last one to run the selection event, in which case the synced var is never updated.

My assumption is that the leaving player won't trigger the select event but trigger the player leave event.
If it trigger the player event then the code in the current version is fine.
 
JASS:
method wait takes nothing returns nothing
            loop
                call TriggerSyncStart()
                call SelectUnit(threadSyncer, true)
                call SelectUnit(threadSyncer, false)
                exitwhen synced_p
                call TriggerSyncReady()
            endloop
        endmethod
or it may not exit loop
 
Because you're using it wrong

It will break something like Network library

In fact,I use library"GameStart" ,and I found it loops Thread.wait and can't get to line "set gameStarted = true".I tried to change method wait,and it worked.
I suggest if Thread is right,GameStart may be wrong.
 
Game Start is correct and it will wait until all players have finished loading the map.


And yes, I just looked.



The problem you speak of, of it never exiting... I've never run into that.

I test it again,and it still don't work before add the two line.
 
Last edited:
just a question, why on earth you kept * * Alloc * hiveworkshop.com/forums/jass-resources-412/snippet-alloc-192348/
there? It is not used, so why having it, it may be confusing because people may think it is typo and will also use Alloc even tho it is not needed

edit: actually, there is implement Alloc in there, so Alloc should actually be required because it will not compile otherwise
 
Nestharus:
  • Writes libraries of code and tests them for 40 hours, so that 1 person can use the code in a script for a map that 2 people will ever play.
  • Writes libraries named "Thread" that don't really give you any control over threads, other than one specific scenario that, as mentioned, 2 people have ever encountered.
  • Claims that he tests his code "hardcore" and there is no probability that it will not work.
  • Discourages people from testing his code (that has been hardcore tested) only to find an "issue" somewhere in the code.

What a joke.
 
0 errors, this runs correctly >.>


Are you sure that you tested it in a synchronous thread? The thread must be synchronous.


This code works perfectly

JASS:
function BooBoo takes nothing returns nothing
    local Thread thread = Thread.create()
    
    if (GetLocalPlayer() == Player(0)) then
        call thread.sync()
    endif
    
    call thread.wait()
    
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"hi")
endfunction

struct Tester extends array
    private static method onInit takes nothing returns nothing
        call ExecuteFunc("BooBoo")
    endmethod
endstruct

Not ganna fix something that's not broken, lol
 
Back
Top