Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision c80fdd0ad758b89c733e2807235fc25f16031905)
+++ uspace/lib/c/generic/async.c	(revision 46eec3b53871d0ac0060777d9d112b18a269c0d3)
@@ -168,4 +168,28 @@
 /** Identifier of the incoming connection handled by the current fibril. */
 fibril_local connection_t *FIBRIL_connection;
+
+static void *default_client_data_constructor(void)
+{
+	return NULL;
+}
+
+static void default_client_data_destructor(void *data)
+{
+}
+
+static async_client_data_ctor_t async_client_data_create =
+    default_client_data_constructor;
+static async_client_data_dtor_t async_client_data_destroy =
+    default_client_data_destructor;
+
+void async_set_client_data_constructor(async_client_data_ctor_t ctor)
+{
+	async_client_data_create = ctor;
+}
+
+void async_set_client_data_destructor(async_client_data_dtor_t dtor)
+{
+	async_client_data_destroy = dtor;
+}
 
 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
@@ -517,4 +541,5 @@
 	client_t *cl;
 	link_t *lnk;
+	void *unref_client_data = NULL;
 
 	/*
@@ -542,5 +567,7 @@
 		}
 		cl->in_task_hash = FIBRIL_connection->in_task_hash;
-		cl->data = NULL;
+		async_serialize_start();
+		cl->data = async_client_data_create();
+		async_serialize_end();
 		cl->refcnt = 1;
 		hash_table_insert(&client_hash_table, &key, &cl->link);
@@ -560,7 +587,11 @@
 	if (--cl->refcnt == 0) {
 		hash_table_remove(&client_hash_table, &key, 1);
+		unref_client_data = cl->data;
 		free(cl);
 	}
 	futex_up(&async_futex);
+
+	if (unref_client_data)
+		async_client_data_destroy(unref_client_data);
 
 	/*
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision c80fdd0ad758b89c733e2807235fc25f16031905)
+++ uspace/lib/c/include/async.h	(revision 46eec3b53871d0ac0060777d9d112b18a269c0d3)
@@ -44,4 +44,8 @@
 
 typedef ipc_callid_t aid_t;
+
+typedef void *(*async_client_data_ctor_t)(void);
+typedef void (*async_client_data_dtor_t)(void *);
+
 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
 
@@ -97,4 +101,7 @@
 extern void async_create_manager(void);
 extern void async_destroy_manager(void);
+
+extern void async_set_client_data_constructor(async_client_data_ctor_t);
+extern void async_set_client_data_destructor(async_client_data_dtor_t);
 
 extern void async_set_client_connection(async_client_conn_t);
