diff options
author | Matthew Johnson <mjj29@hecate.matthew.ath.cx> | 2008-04-18 20:16:12 +0100 |
---|---|---|
committer | Matthew Johnson <mjj29@hecate.matthew.ath.cx> | 2008-04-18 20:16:12 +0100 |
commit | fb8145158aefc9c6e7de5b4ad679e5c9dcbc0530 (patch) | |
tree | 36b7c4fc39fb057cbe051c2f351f9ecc43950819 /org | |
parent | fdc9fa0f332c93e55f6dd7c203dae935b2c85bc6 (diff) |
fix race condition
Diffstat (limited to 'org')
-rw-r--r-- | org/freedesktop/dbus/Message.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/org/freedesktop/dbus/Message.java b/org/freedesktop/dbus/Message.java index 4640630..c514002 100644 --- a/org/freedesktop/dbus/Message.java +++ b/org/freedesktop/dbus/Message.java @@ -177,7 +177,9 @@ public class Message headers = new HashMap<Byte, Object>(); big = (Endian.BIG == endian); bytecounter = 0; - serial = ++globalserial; + synchronized (Message.class) { + serial = ++globalserial; + } if (Debug.debug) Debug.print(Debug.DEBUG, "Creating message with serial "+serial); this.type = type; this.flags = flags; |