We need mutexes in the event system

Stefan (metze) Metzmacher metze at samba.org
Thu Aug 9 13:00:26 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Andrew,

> +/* Set application data onto the event context */
> +
> +void *event_context_application_data(struct event_context *ev) 
> +{
> +	return ev->application_data;
> +}	
> +
> +void event_context_set_application_data(struct event_context *ev, void *data) 
> +{
> +	ev->application_data = talloc_steal(ev, data);
> +}
> Index: lib/events/events_internal.h
> ===================================================================
> --- lib/events/events_internal.h	(revision 24272)
> +++ lib/events/events_internal.h	(working copy)
> @@ -109,6 +109,9 @@
>  
>  	/* pipe hack used with signal handlers */
>  	struct fd_event *pipe_fde;
> +
> +	/* This is private data for the application */
> +	void *application_data; 
>  };

This can't work as you can't garanty that only one function will
set application data, remember in the single process model
a single event context is used for all connections...

It would only make sense to setup an application_data at the time you
create the event context. But a event_context_set_application_data()
which can alter the application data at any time from any event handler
isn't usefull.

Was that also related to
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24282
?

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGuw/qm70gjA5TCD8RAjF0AJ4pN0iLEJZYZmCl57YGWaxlUANGSgCdH4bY
63mvySLXHj13dtQpR+5jXAA=
=9uyI
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list