emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32select.c [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/w32select.c [emacs-unicode-2]
Date: Mon, 28 Jun 2004 03:55:11 -0400

Index: emacs/src/w32select.c
diff -c emacs/src/w32select.c:1.29.2.2 emacs/src/w32select.c:1.29.2.3
*** emacs/src/w32select.c:1.29.2.2      Fri Apr 16 12:50:51 2004
--- emacs/src/w32select.c       Mon Jun 28 07:29:24 2004
***************
*** 249,259 ****
  
    ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext);
  
    if (clipboard_sequence_fn)
      last_clipboard_sequence_number = clipboard_sequence_fn ();
  
-   CloseClipboard ();
- 
    if (ok) goto done;
  
   error:
--- 249,266 ----
  
    ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext);
  
+   CloseClipboard ();
+ 
+   /* Common sense says to read the sequence number inside the
+      OpenClipboard/ CloseClipboard block to avoid race conditions
+      where another app puts something on the clipboard straight after
+      us. But experience suggests that the sequence number from the
+      SetClipboardData is not allocated until we close the clipboard!
+      Since clipboard operations are normally user-driven, the race
+      condition is probably not going to really happen.  */
    if (clipboard_sequence_fn)
      last_clipboard_sequence_number = clipboard_sequence_fn ();
  
    if (ok) goto done;
  
   error:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]