Problem with NSThread threadPriority

Mac OSX specific forum
Wolfram
Enthusiast
Enthusiast
Posts: 568
Joined: Thu May 30, 2013 4:39 pm

Problem with NSThread threadPriority

Post by Wolfram »

Hello!

Can someone tell me why "NSThread threadPriority" doesn't work?

Code: Select all

Procedure MyProcedure(*Value)
  V.f
  P.f = 0.6
  
  CocoaMessage(@R, 0, "NSThread setThreadPriority:@" , @P) ; from 0.0 to 1.0, where 1.0 is highest priority.
  If R
    CocoaMessage(@V, 0, "NSThread threadPriority")
    Debug V ;should be 0.6

    For x=0 To 100
      Delay(5)
    Next
  EndIf
  
  Debug "end thread " +R
EndProcedure


Thread = CreateThread(@MyProcedure(), 0)
Debug "running..."


Repeat
  Delay(10)
Until IsThread(Thread) = 0
macOS Catalina 10.15.7
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Problem with NSThread threadPriority

Post by wilbert »

According to the class reference the type for thread priority should be Double instead of Float.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply