' Thread Sync — THREAD STATUS, CLOSE with sync
#COMPILE EXE
#DIM ALL

FUNCTION Worker(BYVAL dummy AS LONG) AS LONG
    LOCAL i AS LONG
    FOR i = 1 TO 5
        PRINT "Worker iteration " + STR$(i)
        SLEEP 100
    NEXT i
    FUNCTION = 0
END FUNCTION

FUNCTION PBMAIN() AS LONG
    PRINT "=== Thread Sync Demo ==="
    PRINT "Calling worker directly (threading not supported):"
    Worker(1)
    PRINT "Main: done"
    FUNCTION = 0
END FUNCTION
