new $sem = new Thread::Semaphore([val]) Constructor. Creates a new semaphore object, with an optional initial count of val, or if val isn't specified.