Create and use async_block() macro; it cuts down on the visual overhead

of blocking on asynchronous operations, when that isn't an important
aspect of the code.
This commit is contained in:
Michael Brown
2007-01-16 08:10:54 +00:00
parent f11da20f25
commit ff8528ea9a
5 changed files with 54 additions and 28 deletions
+2 -5
View File
@@ -86,11 +86,8 @@ int fetch ( const char *uri_string, userptr_t *data, size_t *len ) {
}
}
async_init_orphan ( &async );
if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
goto err;
async_wait ( &async, &rc, 1 );
if ( rc != 0 )
if ( ( rc = async_block ( &async,
download ( uri, &buffer, &async ) ) ) != 0 )
goto err;
/* Fill in buffer address and length */