summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2014-08-04 14:09:12 -0400
committerSusan LoVerso <sue@wiredtiger.com>2014-08-04 14:09:12 -0400
commit7ea47566e4839f319bb0373973af03dbac4d572a (patch)
tree0e50d110c15ec09347e66a3a347602d34b9a926c /examples
parent81c98807c1d0dfefdd1e96ff71c7b5b6c4c2b3c6 (diff)
downloadmongo-7ea47566e4839f319bb0373973af03dbac4d572a.tar.gz
Add a section to docs for async operations. #1139
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_async.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/c/ex_async.c b/examples/c/ex_async.c
index 1db557e98f0..0998e154f20 100644
--- a/examples/c/ex_async.c
+++ b/examples/c/ex_async.c
@@ -81,8 +81,8 @@ cb_asyncop(WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP *op, int ret, uint32_t flags)
/*! [Get the operation's string value] */
t_ret = op->get_value(op, &v);
value = v.data;
- ATOMIC_ADD(asynckey->num_keys, 1);
/*! [Get the operation's string value] */
+ ATOMIC_ADD(asynckey->num_keys, 1);
printf("Id %" PRIu64 " got record: %s : %s\n", id, key, value);
}
return (t_ret);
@@ -95,13 +95,13 @@ static ASYNC_KEYS ex_asynckeys = { {cb_asyncop}, 0 };
int main(void)
{
- /*! [example connection] */
WT_ASYNC_OP *op;
WT_CONNECTION *wt_conn;
WT_SESSION *session;
int i, ret;
char k[MAX_KEYS][16], v[MAX_KEYS][16];
+ /*! [example connection] */
#define CONN_CONFIG "create,cache_size=100MB," \
"async=(enabled=true,ops_max=10,threads=2)"
if ((ret = wiredtiger_open(home, NULL, CONN_CONFIG, &wt_conn)) != 0) {
@@ -134,12 +134,12 @@ retry:
goto retry;
}
/*! [Allocate a handle] */
- snprintf(k[i], sizeof(k), "key%d", i);
- snprintf(v[i], sizeof(v), "value%d", i);
/*! [Set the operation's string key] */
+ snprintf(k[i], sizeof(k), "key%d", i);
op->set_key(op, k[i]);
/*! [Set the operation's string key] */
/*! [Set the operation's string value] */
+ snprintf(v[i], sizeof(v), "value%d", i);
op->set_value(op, v[i]);
/*! [Set the operation's string value] */
/*! [example insert] */