Newsgroups: comp.lang.c++ Path: utzoo!utgpu!watserv1!watdragon!fkho From: fkho@watdragon.waterloo.edu (Frederick K. Ho) Subject: Question about C++ signal handling Message-ID: <1991Apr22.194302.17795@watdragon.waterloo.edu> Summary: C++ signal callback Organization: University of Waterloo Date: Mon, 22 Apr 1991 19:43:02 GMT Lines: 43 Hi, I would like to know if anyone tried to register a signal inside a member function with the callback signal handler being another member function of the same class? I have experiencing trouble inside the wakeup routine where I got BUS error (alignment error). The this pointer seems to be corrupted. Here's what I did: class A { private: int to; public: A(); ~A(); f(); timeout(); }; A::timeout() { to = 1; } A::f() { // register the signal ::signal(SIGALRM, timeout); ... } Has I done anything wrong? //fred U. of Waterloo -- Internet: fkho@watdragon.waterloo.{edu|ca} UUCP: {ihnp4,decvax,uunet,utai, ...}!watmath!watdragon!fkho Bitnet: fkho@water.BITNET, fkho@water.uwaterloo.ca