Cleanup and some asserts.
This commit is contained in:
parent
3d673c1f02
commit
eb4cdc5026
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: vvm_event.cc,v 1.3 1999/12/12 19:47:54 steve Exp $"
|
||||
#ident "$Id: vvm_event.cc,v 1.4 2000/01/06 05:56:22 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvm.h"
|
||||
|
|
@ -30,6 +30,7 @@ vvm_event::vvm_event()
|
|||
|
||||
vvm_event::~vvm_event()
|
||||
{
|
||||
assert(event_ == 0);
|
||||
}
|
||||
|
||||
void vvm_event::schedule(unsigned long delay)
|
||||
|
|
@ -40,12 +41,16 @@ void vvm_event::schedule(unsigned long delay)
|
|||
void vvm_event::callback_(void*cbd)
|
||||
{
|
||||
vvm_event*obj = reinterpret_cast<vvm_event*>(cbd);
|
||||
obj->event_ = 0;
|
||||
obj->event_function();
|
||||
delete obj;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: vvm_event.cc,v $
|
||||
* Revision 1.4 2000/01/06 05:56:22 steve
|
||||
* Cleanup and some asserts.
|
||||
*
|
||||
* Revision 1.3 1999/12/12 19:47:54 steve
|
||||
* Remove the useless vvm_simulation class.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: vvm_thread.cc,v 1.2 1999/12/12 19:47:54 steve Exp $"
|
||||
#ident "$Id: vvm_thread.cc,v 1.3 2000/01/06 05:56:23 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvm.h"
|
||||
|
|
@ -28,7 +28,11 @@ class delay_event : public vvm_event {
|
|||
|
||||
public:
|
||||
delay_event(vvm_thread*thr) : thr_(thr) { }
|
||||
void event_function() { while (thr_->go()) /* empty */; }
|
||||
void event_function()
|
||||
{
|
||||
while (thr_->go())
|
||||
/* empty */;
|
||||
}
|
||||
private:
|
||||
vvm_thread*thr_;
|
||||
};
|
||||
|
|
@ -50,6 +54,9 @@ void vvm_thread::thread_yield(unsigned long delay)
|
|||
|
||||
/*
|
||||
* $Log: vvm_thread.cc,v $
|
||||
* Revision 1.3 2000/01/06 05:56:23 steve
|
||||
* Cleanup and some asserts.
|
||||
*
|
||||
* Revision 1.2 1999/12/12 19:47:54 steve
|
||||
* Remove the useless vvm_simulation class.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: vvm_thread.h,v 1.3 1999/12/12 19:47:54 steve Exp $"
|
||||
#ident "$Id: vvm_thread.h,v 1.4 2000/01/06 05:56:23 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvm.h"
|
||||
|
|
@ -46,11 +46,13 @@ class vvm_thread {
|
|||
// will return false if it is ready to give up the CPU.
|
||||
virtual bool go() =0;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
/*
|
||||
* $Log: vvm_thread.h,v $
|
||||
* Revision 1.4 2000/01/06 05:56:23 steve
|
||||
* Cleanup and some asserts.
|
||||
*
|
||||
* Revision 1.3 1999/12/12 19:47:54 steve
|
||||
* Remove the useless vvm_simulation class.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue