I'm wondering how I can accomplish a serial queue of events on a Thread subclass. For instance, in this concept, how would I do this without semaphores?
class DBClass: Thread {
// queue property here
override func main() {
while true {
// serially execute queued requests
// sleep thread
}
}
public func execute(_ theCommand: String) async throws {
// queue request
// wake thread
// wait for main to get to it and return after request is executed
}
}