Abstract: A method is disclosed for providing exception support in a computer having an operating system, the operating system providing application programming interfaces for use by a threads library to create, execute and cancel process threads. The threads library normally maintains a cleanup handler stack for each thread for use in effecting clean-up of state upon receipt of a thread cancel. The method begins when there is a predetermined exception handling macro associated with a current thread by pushing a pair of pointers onto the cleanup handler stack of that thread. The first pointer identifies a predetermined function and the second pointer identifies a particular exception context. Upon receipt of a thread cancel for the thread, the threads library invokes the predetermined function as a cleanup handler (with the exception context as its argument) to thereby map the thread cancel into an exception. The exception is then processed using an exception handling mechanism.
Type:
Grant
Filed:
September 12, 1995
Date of Patent:
July 21, 1998
Assignee:
International Busines Machines Corporation