File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace ov {
8
8
namespace genai {
9
+
10
+ std::mutex Sequence::m_counter_mutex;
11
+
9
12
size_t Sequence::_make_hash (size_t content_length) {
10
13
auto sequence_group = get_sequence_group_ptr ();
11
14
auto block_size = sequence_group->get_block_size ();
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class SequenceGroup;
27
27
class Sequence {
28
28
// This can be a problem if we launch two pipelines in the same application.
29
29
static uint64_t _get_next_global_sequence_id () {
30
+ const std::lock_guard<std::mutex> lock (m_counter_mutex);
30
31
static uint64_t m_counter = 0 ;
31
32
return m_counter++;
32
33
}
@@ -40,6 +41,7 @@ class Sequence {
40
41
float m_cumulative_log_prob = 0 .0f ;
41
42
std::vector<int64_t > m_prefix_hashes;
42
43
std::weak_ptr<SequenceGroup> m_sequence_group;
44
+ static std::mutex m_counter_mutex;
43
45
44
46
size_t _make_hash (size_t content_length);
45
47
public:
You can’t perform that action at this time.
0 commit comments