Browse Source

tm: AS added needed membar

When compiled with -DWITH_AS_SUPPORT build_local_ack() needed
a membar_write_atomic_op() before setting the new local ack retr.
buf pointer (this will force the local_ack content to be fully
written before replacing the pointer and it's need on some non-x86
archs.).
Andrei Pelinescu-Onciul 16 năm trước cách đây
mục cha
commit
f0ab0db3b6
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      modules/tm/t_reply.c

+ 4 - 0
modules/tm/t_reply.c

@@ -414,6 +414,10 @@ static char *build_local_ack(struct sip_msg* rpl, struct cell *trans,
 	}
 
 	/* set the new buffer, but only if not already set (concurrent 2xx) */
+	/* a memory write barrier is needed to make sure the local_ack
+	   content is fully written, before we try to add it to the transaction
+	   -- andrei */
+	membar_write_atomic_op();
 	if ((old_lack = (struct retr_buf *)atomic_cmpxchg_long(
 			(void *)&trans->uac[0].local_ack, 0, (long)local_ack))) {
 		/* buffer already set: trash current and use the winning one */