BindToClose extended yield w/ coroutine.yield()


Note that this isn’t Calling YieldFunctions from BindToClose functions hangs Studio after clicking Stop button
At least for me, just having a wait() resumes properly

My repro is this:

local t
	print'set t;yielding'
	local s=tick()
	print('unyielded after '..(tick()-s))

print'waiting for t'
repeat until t or not wait()
print'got t'
print'resumed t'

Relevant studio output shows:

waiting for t
set t;yielding
19:34:38.276 - Disconnect from|63659
got t
unyielded after 0.03760552406311
resumed t

As you can see, my thread supposedly unyields after the expected ~1/30 seconds yet if you actually run the code in studio, studio freezes for ~30 seconds (the timeout)


This was intentionally changed a few months back. coroutine.yield will now yield a thread until it is explicitly resumed with coroutine.resume.

Let me tell you: this made Event:wait() way easier to code. :slight_smile:


might want to reread the thread


Yes, coroutine yielding doesn’t work properly in BindToClose.

It has already been reported here:

closed #5