[3063] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[barnowl/barnowl] feeb83: Remove OwlGlobalNotifier typedef

daemon@ATHENA.MIT.EDU (noreply@github.com)
Mon May 23 23:13:16 2011

Date: Mon, 23 May 2011 20:13:13 -0700
To: barnowl-dev@mit.edu
From: noreply@github.com

Branch: refs/heads/master
Home:   https://github.com/barnowl/barnowl

Commit: feeb835e67f9323d25211447865b3c0e426129b5
    https://github.com/barnowl/barnowl/commit/feeb835e67f9323d25211447865b3c0e426129b5
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.h

Log Message:
-----------
Remove OwlGlobalNotifier typedef

Ugh. This is what I get for being sloppy with my experiments.


Commit: 57bc1411273d3124b9a5012a3921589884013040
    https://github.com/barnowl/barnowl/commit/57bc1411273d3124b9a5012a3921589884013040
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M select.c

Log Message:
-----------
Punt _owl_select_timer_eq

It hasn't been used for a long time.


Commit: ebb849842513c01db5315c57563d628c573b7831
    https://github.com/barnowl/barnowl/commit/ebb849842513c01db5315c57563d628c573b7831
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M select.c

Log Message:
-----------
Mark some functions static

They were never called outside select.c


Commit: 125536565b016a2dc0130569f6192cfebbe39f49
    https://github.com/barnowl/barnowl/commit/125536565b016a2dc0130569f6192cfebbe39f49
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M configure.ac

Log Message:
-----------
Link to gthread-2.0 so we can use glib's threading code


Commit: 2c79eae5e102073224cebae432e5c3ca7122da9f
    https://github.com/barnowl/barnowl/commit/2c79eae5e102073224cebae432e5c3ca7122da9f
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M global.c
  M owl.h
  M select.c

Log Message:
-----------
Start of GMainContext code

Add GSources to feed owl_timer and owl_io_dispatch events into the main
loop. Also add a hack so pre-select actions run at all. Glib's main loop
has a hard priority system, so it prefers that prepare/check hooks
return if the event would actually do anything. We probably want to
replace every pre-select action with a dedicated GSource (or maybe a
bunch of g_idle_add calls).

Signals are also racy right now; glib uses select/poll instead of
pselect/ppoll, so you can't actually listen for signals on the same
thread. (In fact, the single-threaded version of g_child_watch_add
doesn't actually work.) That's okay as what we were doing doesn't work
when you add a second thread and thread safety is sort of the point of
this work.

The AIM hack need also be restored. Keep owl_select around for now as
reference.


Commit: 4cc49bce5bdc20cd8da2b4e305f60d04ae879d4f
    https://github.com/barnowl/barnowl/commit/4cc49bce5bdc20cd8da2b4e305f60d04ae879d4f
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M window.c
  M window.h

Log Message:
-----------
Make the owl_window redraw hook a GSource

(Should this be a g_idle_add instead?)

This is the first pre-select action to die.


Commit: 6b4033fde87324642e82407c6fd2b2fb1bd952b8
    https://github.com/barnowl/barnowl/commit/6b4033fde87324642e82407c6fd2b2fb1bd952b8
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c

Log Message:
-----------
Also make owl_process_messages a GSource

This is the second pre-select action.


Commit: 959cb85c4c02b9474fc3ece82a6ebc7f47ee2cf3
    https://github.com/barnowl/barnowl/commit/959cb85c4c02b9474fc3ece82a6ebc7f47ee2cf3
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M zephyr.c

Log Message:
-----------
Add a zephyr GSource

This may actually have some use as a GSource instead of g_idle_add since
we queue messages up and only process so many at a time. The use of
ZQLength isn't strictly necessary, but we may as well be fancy and wait
for the poll() to tell us if there's any point in reading before doing
so.

This is the third pre-select action.


Commit: 3535a6e36df4c6beed134aef3f7f81c7f9ea6dd2
    https://github.com/barnowl/barnowl/commit/3535a6e36df4c6beed134aef3f7f81c7f9ea6dd2
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M Makefile.am
  M functions.c
  M global.c
  M owl.c
  M owl.h
  M select.c
  A signal.c

Log Message:
-----------
First go at sigwait-based signal handling

Instead of relying on pselect and signal masking to listen for signals,
which glib doesn't support, we spawn a dedicated signal thread that
loops in sigwait. These signals are posted back to the main message loop
which may handle them at will. This avoids the need for complex
reentrant code and sig_atomic_t.

This removes the final pre-select action.

SIGINT doesn't quite work right yet because we can no longer take it in
the middle of an event loop iteration.


Commit: 257b9c4167ca2e12d88c2e3296cee64846a2a8cd
    https://github.com/barnowl/barnowl/commit/257b9c4167ca2e12d88c2e3296cee64846a2a8cd
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M global.c
  M owl.h
  M select.c

Log Message:
-----------
Punt pre-select actions

The four users are now directly handled with GSources.


Commit: 81db14273db38ca35282e377174c4ad3a961e2f2
    https://github.com/barnowl/barnowl/commit/81db14273db38ca35282e377174c4ad3a961e2f2
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M signal.c

Log Message:
-----------
Make owl_signal_init take a signal-thread callback

Instead of pushing the work directly the main thread. This will allow us
to react to SIGINT earlier.


Commit: e2cc8487b365b026214922326e880825057eb9e6
    https://github.com/barnowl/barnowl/commit/e2cc8487b365b026214922326e880825057eb9e6
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M filterproc.c
  M owl.c

Log Message:
-----------
Just ignore SIGPIPE altogether

There's not much point in switching back and forth from ignoring it and
mostly ignoring it. Also, we don't handle SIGCHLD so remove the code for
it.

(We actually also disable it in the Jabber module because XML::Stream
sets $SIG{PIPE}. Meh.)


Commit: 1491439530e27b3a8f5cea9620740a5f53296f85
    https://github.com/barnowl/barnowl/commit/1491439530e27b3a8f5cea9620740a5f53296f85
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c

Log Message:
-----------
Don't deliver SIGALRM through the signal thread

We don't do anything with it, and code that uses alarm(), of which we
have none, wouldn't expect it to be set to something useful anyway.


Commit: 47128d939b8cf3c9833095b626efc1efcee0744f
    https://github.com/barnowl/barnowl/commit/47128d939b8cf3c9833095b626efc1efcee0744f
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M functions.c
  M global.c
  M owl.c
  M owl.h

Log Message:
-----------
Allow interrupts to be taken at any point

This way we can catch SIGINT in the middle of a search if we care.
(Though ideally we wouldn't block the event loop when searching like
this.)


Commit: 6bd485e66082d346565079eeb25dbb3f98f396c9
    https://github.com/barnowl/barnowl/commit/6bd485e66082d346565079eeb25dbb3f98f396c9
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M signal.c

Log Message:
-----------
Reset signal dispositions and mask, in case our parent was lame

Also check return values more carefully.


Commit: 08e98424a5b5d007e27d36d066a6e3ab2c017b84
    https://github.com/barnowl/barnowl/commit/08e98424a5b5d007e27d36d066a6e3ab2c017b84
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M signal.c

Log Message:
-----------
Cleanly destroy the signal thread on shutdown

This isn't strictly necessary here, but we should probably be in the
habit of safely cleaning up our helper threads.

Switch the implementation from GThread to pthreads directly. The
cleanest way to kill a signaling thread is to send it SIGTERM with
pthread_kill, but GThread doesn't expose that and gives no way to get at
the pthread_t.


Commit: dc1edbded39e57c67e8049c2960f0c235cd5afb5
    https://github.com/barnowl/barnowl/commit/dc1edbded39e57c67e8049c2960f0c235cd5afb5
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M aim.c
  M global.c
  M owl.h
  M select.c

Log Message:
-----------
Add a GSource for AIM events

The AIM file descriptor hack is somewhat less of a hack now. Remove code
related to the old AIM implementation now that it's been superceded.


Commit: 117b2ba23a435fcf28264abcf452c5d531bbafb2
    https://github.com/barnowl/barnowl/commit/117b2ba23a435fcf28264abcf452c5d531bbafb2
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M select.c

Log Message:
-----------
Move owl_process_input_char to owl.c

It would be nice to move some functions out of there too, but it really
makes no sense in select.c.


Commit: ba12b446949c02a6b7649d518b91def2056e2cbb
    https://github.com/barnowl/barnowl/commit/ba12b446949c02a6b7649d518b91def2056e2cbb
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M select.c

Log Message:
-----------
Add owl_select_post_task helper function

Honestly, the only thing you'd ever want to do to a message loop from
another thread is post a one-off task to it. Why Glib makes this so
difficult is beyond me.


Commit: 1d21d9fd6efdecb79b0bef96aabee3943d6a955a
    https://github.com/barnowl/barnowl/commit/1d21d9fd6efdecb79b0bef96aabee3943d6a955a
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.c
  M signal.c

Log Message:
-----------
Use sigwaitinfo instead of sigwait

Eh, may as well give the signal handlers a little bit more rope.


Commit: f97c1a6dc51969eb5ce71f2b4eddf3a13d2abc6c
    https://github.com/barnowl/barnowl/commit/f97c1a6dc51969eb5ce71f2b4eddf3a13d2abc6c
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M Makefile.am
  M aim.c
  M configure.ac
  M filterproc.c
  M functions.c
  M global.c
  M owl.c
  M owl.h
  M select.c
  A signal.c
  M window.c
  M window.h
  M zephyr.c

Log Message:
-----------
Merge branch 'g_main_loop'

The logic in owl_select_prune_bad_fds still needs to be reimplemented.

Conflicts:
	configure.ac
	owl.c
	select.c


Commit: 33b6431b480426ea3c8334c4c6de3f19ad477071
    https://github.com/barnowl/barnowl/commit/33b6431b480426ea3c8334c4c6de3f19ad477071
Author: David Benjamin <davidben@mit.edu>
Date:   2011-05-23 (Mon, 23 May 2011)

Changed paths:
  M owl.h
  M select.c

Log Message:
-----------
Clarify owl_io_dispatch ownership

A created owl_io_dispatch is owned by whoever created. For instances
where owl_select needs to remove one of them, we instead invalidate
them. In the case of perl IO dispatches, they are owned by the nebulous
blob that implicitly maps fd to IO dispatch. This is completely insane,
but should avoid leaving people with invalid owl_io_dispatch pointers.

Use this same mechanism to restore owl_select_prune_bad_fds logic.

We really need to kill this and owl_timer in favor of glib's things.


Compare: https://github.com/barnowl/barnowl/compare/4c7c21f...33b6431

home help back first fref pref prev next nref lref last post