Skip to contentSkip to conversation

Use pthread_equal() for pthread_t's equality test

PATCH In review Bert Wesarg 2 participants 3 messages Feb 6, 2009 – May 13, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use pthread_equal() for pthread_t's equality test

---
 urcu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
urcu.c +1 -1
index d0d6138..e401d8d 100644
@@ -185,7 +185,7 @@ void urcu_remove_reader(pthread_t id)
 
 	assert(reader_data != NULL);
 	for (index = reader_data; index < reader_data + num_readers; index++) {
-		if (index->tid == id) {
+		if (pthread_equal(index->tid, id)) {
 			memcpy(index, &reader_data[num_readers - 1],
 				sizeof(struct reader_data));
 			reader_data[num_readers - 1].tid = 0;
Signature · 1 line
1.6.1.rc4
#1 lore raw
Quoted 5 lines · * Bert Wesarg ([email protected]) wrote:
---
 urcu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Hi Bert,

I have to ask all userspace RCU committers for permission to move the code to LGPL. IBM already gave their approval. Is it OK with you wrt to the patch you posted here ?

Mathieu

Quoted 16 lines
urcu.c +1 -1
index d0d6138..e401d8d 100644
@@ -185,7 +185,7 @@ void urcu_remove_reader(pthread_t id)
 
 	assert(reader_data != NULL);
 	for (index = reader_data; index < reader_data + num_readers; index++) {
-		if (index->tid == id) {
+		if (pthread_equal(index->tid, id)) {
 			memcpy(index, &reader_data[num_readers - 1],
 				sizeof(struct reader_data));
 			reader_data[num_readers - 1].tid = 0;
Signature · 1 line
1.6.1.rc4
Signature · 2 lines
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#2 lore raw
Quoted 8 lines · Mathieu Desnoyers
Quoted 5 lines · * Bert Wesarg ([email protected]) wrote:

---
 urcu.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

Hi Bert,

Hi Mathieu,

Quoted 4 lines

I have to ask all userspace RCU committers for permission to move the code to LGPL. IBM already gave their approval. Is it OK with you wrt to the patch you posted here ?

Yes, it's ok.

Bert

Quoted 2 lines

Mathieu