diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-02-24 02:08:23 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-02-24 02:08:23 +0000 |
commit | 7dd9359613346715a5522b3e72af3612f40d18a7 (patch) | |
tree | e8c0a68f95e7c16819301ef928eef14ad284ca11 | |
parent | 43fbdead5e8453ef71a27eec23298f6e47676576 (diff) | |
download | ATCD-7dd9359613346715a5522b3e72af3612f40d18a7.tar.gz |
ChangeLogTag:Wed Feb 23 18:58:06 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 13 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 13 | ||||
-rw-r--r-- | ace/Synch.h | 5 | ||||
-rw-r--r-- | ace/Synch.i | 5 | ||||
-rw-r--r-- | tests/FlReactor_Test.cpp | 81 |
6 files changed, 76 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog index 18206fc51a0..62f41c4785b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,19 @@ Wed Feb 23 18:58:06 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * tests/FlReactor_Test.cpp (main): Minor reformatting. + * ace/config-win32-borland.h: When you define _DEBUG the orbsvcs dll exports all "inline" functions, and this seems to be too much for BCB4 linker. Thaddeus L. Olczyk <olczyk@interaccess.com> reported this problem and Christopher Kohlhoff <chris@kohlhoff.com> provided the fix. - * ace/OS: Added a new parameter to flock_destroy() that controls - whether the lockfile is removed when the filelock is destroyed. - By default, this is "enabled" so the existing semantics don't - change. Thanks to Sangwoo Jin <swjinjin@sei.co.kr> for - suggesting this. + * ace/OS, + ace/Synch: Added a new parameter to flock_destroy() and + ACE_File_Lock::remove() that controls whether the lockfile is + removed when the filelock is destroyed. By default, this is + "enabled" so the existing semantics don't change. Thanks to + Sangwoo Jin <swjinjin@sei.co.kr> for suggesting this. Wed Feb 23 16:54:31 2000 Steve Huston <shuston@riverace.com> diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 18206fc51a0..62f41c4785b 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,16 +1,19 @@ Wed Feb 23 18:58:06 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * tests/FlReactor_Test.cpp (main): Minor reformatting. + * ace/config-win32-borland.h: When you define _DEBUG the orbsvcs dll exports all "inline" functions, and this seems to be too much for BCB4 linker. Thaddeus L. Olczyk <olczyk@interaccess.com> reported this problem and Christopher Kohlhoff <chris@kohlhoff.com> provided the fix. - * ace/OS: Added a new parameter to flock_destroy() that controls - whether the lockfile is removed when the filelock is destroyed. - By default, this is "enabled" so the existing semantics don't - change. Thanks to Sangwoo Jin <swjinjin@sei.co.kr> for - suggesting this. + * ace/OS, + ace/Synch: Added a new parameter to flock_destroy() and + ACE_File_Lock::remove() that controls whether the lockfile is + removed when the filelock is destroyed. By default, this is + "enabled" so the existing semantics don't change. Thanks to + Sangwoo Jin <swjinjin@sei.co.kr> for suggesting this. Wed Feb 23 16:54:31 2000 Steve Huston <shuston@riverace.com> diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 18206fc51a0..62f41c4785b 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,16 +1,19 @@ Wed Feb 23 18:58:06 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * tests/FlReactor_Test.cpp (main): Minor reformatting. + * ace/config-win32-borland.h: When you define _DEBUG the orbsvcs dll exports all "inline" functions, and this seems to be too much for BCB4 linker. Thaddeus L. Olczyk <olczyk@interaccess.com> reported this problem and Christopher Kohlhoff <chris@kohlhoff.com> provided the fix. - * ace/OS: Added a new parameter to flock_destroy() that controls - whether the lockfile is removed when the filelock is destroyed. - By default, this is "enabled" so the existing semantics don't - change. Thanks to Sangwoo Jin <swjinjin@sei.co.kr> for - suggesting this. + * ace/OS, + ace/Synch: Added a new parameter to flock_destroy() and + ACE_File_Lock::remove() that controls whether the lockfile is + removed when the filelock is destroyed. By default, this is + "enabled" so the existing semantics don't change. Thanks to + Sangwoo Jin <swjinjin@sei.co.kr> for suggesting this. Wed Feb 23 16:54:31 2000 Steve Huston <shuston@riverace.com> diff --git a/ace/Synch.h b/ace/Synch.h index 090cb83ef28..5616ae26c42 100644 --- a/ace/Synch.h +++ b/ace/Synch.h @@ -162,8 +162,9 @@ public: ~ACE_File_Lock (void); // Remove a File lock by releasing it and closing down the <handle_>. - int remove (void); - // Remove a File lock by releasing it and closing down the <handle_>. + int remove (int unlink_file = 1); + // Remove a File lock by releasing it and closing down the + // <handle_>. If <unlink_file> is non-0 then we unlink the file. int acquire (short whence = 0, off_t start = 0, off_t len = 1); // Note, for interface uniformity with other synchronization diff --git a/ace/Synch.i b/ace/Synch.i index f232df780ca..105144193b6 100644 --- a/ace/Synch.i +++ b/ace/Synch.i @@ -56,7 +56,7 @@ ACE_File_Lock::release (short whence, off_t start, off_t len) } ACE_INLINE int -ACE_File_Lock::remove (void) +ACE_File_Lock::remove (int unlink_file) { // ACE_TRACE ("ACE_File_Lock::remove"); @@ -65,7 +65,8 @@ ACE_File_Lock::remove (void) if (this->removed_ == 0) { this->removed_ = 1; - result = ACE_OS::flock_destroy (&this->lock_); + result = ACE_OS::flock_destroy (&this->lock_, + unlink_file); } return result; } diff --git a/tests/FlReactor_Test.cpp b/tests/FlReactor_Test.cpp index b7afb411cb8..9e2ff5f21ca 100644 --- a/tests/FlReactor_Test.cpp +++ b/tests/FlReactor_Test.cpp @@ -13,10 +13,13 @@ // A simple test that ilustrates the integration of the fast-light // toolkit (http://fltk.easysw.org/) with ACE, it uses FL to create // an OpenGL window and display a polygon, it uses ACE to open an -// acceptor. Every time there is a connection the number of polygons -// is increased, a little widget can be used to change the number of +// acceptor. Every time there is a connection the number of polygons +// is increased, a little widget can be used to change the number of // polygons too. // +// = AUTHOR +// Carlos O'Ryan <coryan@cs.wustl.edu> +// // ============================================================================ #include "test_config.h" @@ -25,7 +28,8 @@ ACE_RCSID(tests, FlReactor_Test, "$Id$") #if !defined (ACE_HAS_FL) -int main (int, char*[]) +int +main (int, char*[]) { ACE_START_TEST (ASYS_TEXT ("FlReactor_Test")); @@ -58,7 +62,7 @@ class Test_Window : public Fl_Gl_Window { public: Test_Window (int x, int y, int w, int h, - const char * l = 0); + const char * l = 0); // Constructor int sides (void) const; @@ -107,33 +111,36 @@ Test_Window::draw (void) { // the valid() property may be used to avoid reinitializing your // GL transformation for each redraw: - if (!this->valid()) + if (!this->valid ()) { - this->valid(1); - glLoadIdentity(); - glViewport(0, 0, this->w(), this->h()); + this->valid (1); + glLoadIdentity (); + glViewport (0, 0, this->w (), this->h ()); } // draw an amazing but slow graphic: - glClear(GL_COLOR_BUFFER_BIT); + glClear (GL_COLOR_BUFFER_BIT); - glBegin(GL_POLYGON); + glBegin (GL_POLYGON); int s = this->sides_; - for (int i=0; i != s; ++i) + + for (int i = 0; i != s; ++i) { double ang = i * 2 * M_PI / s; - glColor3f (float(i) / s, - float(i) / s, - float(i) / s); - glVertex3f(cos(ang), sin(ang), 0); + glColor3f (float (i) / s, + float (i) / s, + float (i) / s); + glVertex3f (cos (ang), sin (ang), 0); } - glEnd(); + glEnd (); } -// when you change the data, as in this callback, you must call redraw(): +// when you change the data, as in this callback, you must call redraw (): void sides_cb (Fl_Widget *o, void *p) { - Test_Window *tw = ACE_reinterpret_cast(Test_Window *,p); - Fl_Slider *slider = ACE_dynamic_cast (Fl_Slider*,o); + Test_Window *tw = + ACE_reinterpret_cast (Test_Window *,p); + Fl_Slider *slider = + ACE_dynamic_cast (Fl_Slider*,o); tw->sides (ACE_static_cast (int, slider->value ())); } @@ -147,7 +154,7 @@ public: virtual int handle_input (ACE_HANDLE); private: - Test_Window* w_; + Test_Window *w_; Fl_Box *box_; }; @@ -226,17 +233,17 @@ int main (int argc, char *argv[]) { ACE_START_TEST (ASYS_TEXT ("FlReactor_Test")); - Fl_Window window(300, 370); + Fl_Window window (300, 370); - Test_Window tw(10, 75, window.w() - 20, window.h()-90); - window.resizable(&tw); + Test_Window tw (10, 75, window.w () - 20, window.h ()-90); + window.resizable (&tw); - Fl_Hor_Slider slider(60, 5, window.w() - 70, 30, "Sides:"); - slider.align(FL_ALIGN_LEFT); - slider.callback(sides_cb, &tw); - slider.value(tw.sides ()); - slider.step(1); - slider.bounds(3, 10); + Fl_Hor_Slider slider (60, 5, window.w () - 70, 30, "Sides:"); + slider.align (FL_ALIGN_LEFT); + slider.callback (sides_cb, &tw); + slider.value (tw.sides ()); + slider.step (1); + slider.bounds (3, 10); ACE_FlReactor reactor; ACE_Reactor r (&reactor); @@ -249,8 +256,12 @@ int main (int argc, char *argv[]) Acceptor acceptor (&tw, box); ACE_INET_Addr address; + if (acceptor.open (address, &r) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open acceptor"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "open acceptor"), + -1); acceptor.acceptor ().get_local_addr (address); @@ -259,17 +270,17 @@ int main (int argc, char *argv[]) address.addr_to_string (buf, bufsiz, 0); - char msg[2*bufsiz]; + char msg[2 * bufsiz]; ACE_OS::sprintf (msg, "Listening on <%s>\n", buf); box->label (msg); box->redraw (); - window.end(); - window.show(argc,argv); - tw.show(); + window.end (); + window.show (argc, argv); + tw.show (); - return Fl::run(); + return Fl::run (); ACE_END_TEST; } |