Changeset 86693 in vbox for trunk/src/VBox
- Timestamp:
- Oct 23, 2020 3:29:07 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141075
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r86684 r86693 848 848 if (pCtx->fGrabClipboardOnStart) 849 849 clipQueryX11FormatsCallback(pCtx); 850 851 /* We're now ready to run, tell parent. */ 852 int rc2 = RTThreadUserSignal(hThreadSelf); 853 AssertRC(rc2); 850 854 851 855 while (XtAppGetExitFlag(pCtx->appContext) == FALSE) … … 1134 1138 int ShClX11ThreadStart(PSHCLX11CTX pCtx, bool fGrab) 1135 1139 { 1136 int rc = VINF_SUCCESS;1140 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1137 1141 1138 1142 /* … … 1142 1146 return VINF_SUCCESS; 1143 1147 1144 rc = clipInit(pCtx);1148 int rc = clipInit(pCtx); 1145 1149 if (RT_SUCCESS(rc)) 1146 1150 { 1147 1151 clipResetX11Formats(pCtx); 1148 1152 pCtx->fGrabClipboardOnStart = fGrab; 1149 } 1153 1150 1154 #ifndef TESTCASE 1151 if (RT_SUCCESS(rc))1152 {1153 1155 LogRel2(("Shared Clipboard: Starting X11 event thread ...\n")); 1154 1156 1155 1157 rc = RTThreadCreate(&pCtx->Thread, clipEventThread, pCtx, 0, 1156 1158 RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "SHCLX11"); 1159 if (RT_SUCCESS(rc)) 1160 rc = RTThreadUserWait(pCtx->Thread, RT_MS_30SEC /* msTimeout */); 1161 1157 1162 if (RT_FAILURE(rc)) 1158 1163 { … … 1160 1165 clipUninit(pCtx); 1161 1166 } 1162 } 1163 #endif 1167 else 1168 LogRel2(("Shared Clipboard: X11 event thread started\n")); 1169 #endif 1170 } 1171 1164 1172 return rc; 1165 1173 } … … 1178 1186 int ShClX11ThreadStop(PSHCLX11CTX pCtx) 1179 1187 { 1180 int rc, rcThread;1181 unsigned count = 0;1182 1188 /* 1183 1189 * Immediately return if we are not connected to the X server. … … 1186 1192 return VINF_SUCCESS; 1187 1193 1188 LogRel (("Shared Clipboard: Stopping X11 event thread ...\n"));1194 LogRel2(("Shared Clipboard: Stopping X11 event thread ...\n")); 1189 1195 1190 1196 /* Write to the "stop" pipe. */ 1191 1197 clipQueueToEventThread(pCtx, clipStopEventThreadWorker, (XtPointer)pCtx); 1192 1198 1199 int rc; 1200 1193 1201 #ifndef TESTCASE 1194 do 1195 { 1196 rc = RTThreadWait(pCtx->Thread, 1000, &rcThread); 1197 ++count; 1198 Assert(RT_SUCCESS(rc) || ((VERR_TIMEOUT == rc) && (count != 5))); 1199 } while ((VERR_TIMEOUT == rc) && (count < 300)); 1202 LogRel2(("Shared Clipboard: Waiting for X11 event thread to stop ...\n")); 1203 1204 int rcThread; 1205 rc = RTThreadWait(pCtx->Thread, RT_MS_30SEC /* msTimeout */, &rcThread); 1206 if (RT_SUCCESS(rc)) 1207 rc = rcThread; 1208 1209 if (RT_FAILURE(rc)) 1210 LogRel(("Shared Clipboard: Stopping X11 event thread failed with %Rrc\n", rc)); 1200 1211 #else 1201 1212 rc = VINF_SUCCESS; 1202 rcThread = VINF_SUCCESS; 1203 RT_NOREF_PV(count); 1204 #endif 1205 if (RT_SUCCESS(rc)) 1206 { 1207 AssertRC(rcThread); 1208 } 1209 else 1210 LogRel(("Shared Clipboard: Stopping X11 event thread failed with %Rrc\n", rc)); 1213 #endif 1214 1215 LogRel2(("Shared Clipboard: X11 event thread stopped\n")); 1211 1216 1212 1217 clipUninit(pCtx); 1213 1214 RT_NOREF_PV(rcThread);1215 1218 return rc; 1216 1219 }
Note:
See TracChangeset
for help on using the changeset viewer.