From 23d30b9ddb997e64d6d463856df4c9f16bfaa117 Mon Sep 17 00:00:00 2001 From: Ryoji Kurosawa Date: Thu, 19 Sep 2024 13:35:12 +0900 Subject: [PATCH 1/2] docs: add a note on concurrent invocations of datastore::switch_epoch and log_channel::begin_session --- include/limestone/api/log_channel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/limestone/api/log_channel.h b/include/limestone/api/log_channel.h index bfcf1128..8832b4ae 100644 --- a/include/limestone/api/log_channel.h +++ b/include/limestone/api/log_channel.h @@ -48,6 +48,8 @@ class log_channel { * @brief join a persistence session for the current epoch in this channel * @attention this function is not thread-safe. * @note the current epoch is the last epoch specified by datastore::switch_epoch() + * @note datastore::switch_epoch() and this function can be called simultaneously. + * If these functions invocation overwrap, the current epoch that the session joins depends on timing. */ void begin_session(); From e5a0cd0121be1ad2718a4cc422279f8242ad3524 Mon Sep 17 00:00:00 2001 From: Ryoji Kurosawa Date: Tue, 24 Sep 2024 17:39:30 +0900 Subject: [PATCH 2/2] reflect PR comment --- include/limestone/api/log_channel.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/limestone/api/log_channel.h b/include/limestone/api/log_channel.h index 8832b4ae..23288fcb 100644 --- a/include/limestone/api/log_channel.h +++ b/include/limestone/api/log_channel.h @@ -48,8 +48,9 @@ class log_channel { * @brief join a persistence session for the current epoch in this channel * @attention this function is not thread-safe. * @note the current epoch is the last epoch specified by datastore::switch_epoch() - * @note datastore::switch_epoch() and this function can be called simultaneously. - * If these functions invocation overwrap, the current epoch that the session joins depends on timing. + * @note datastore::switch_epoch() and this function can be called simultaneously. + * If these functions are invoked at the same time, the result will be as if one of them was called first, + * but it is indeterminate which one will take precedence. */ void begin_session();