pytalloc: Improve timer wrapper, and test it
authorPetr Viktorin <pviktori@redhat.com>
Tue, 26 May 2015 11:25:12 +0000 (13:25 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Jun 2015 04:06:19 +0000 (06:06 +0200)
commit560576217f11b132f9c32de6e41c623dbc152137
tree00ea621614defa31c8cbf2a1a3becb7388fa453b
parent4399dc582fa06b04e1cec1d3aa59cd332e4b5ba2
pytalloc: Improve timer wrapper, and test it

Using Context.add_timer resulted in crashes due to missing type object
and bad reference handling.
Add a TeventTimer_Type struct, and introduce a clear ownership/lifetime model.

Add a "add_timer_offset" to allow adding timers from Python. (add_timer
requires passing struct timeval as a Python integer, which can't really
be done portably).

Add tests.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
lib/tevent/bindings.py
lib/tevent/pytevent.c
lib/tevent/wscript