Easy installation: 1. Run DevStudio. 2. Go to menu: Tools->Customize. 3. Select Add-ins and Macro Files tab. 4. Use Browse button to locate and select CvsIn.dll file.
5. Make sure the checkbox to the left of CvsIn is checked. 6. Click Close button.
Note: To uninstall simply un-check the checkbox next to the CvsIn and press Close button. You can also close DevStudio and remove CvsIn.dll file.
User interface consist of the following: 1. Toolbars. o CvsIn Options - to invoke the Options dialog where you can change the CvsIn settings. o Run WinCvs - launch WinCvs for the current file, or find already running one. CVS commands toolbars: o CVS update - cvs update <active file> o CVS commit - cvs commit <active file> o Query CVS update - cvs -n update <active file> o CVS diff - cvs diff <active file>
o CVS log - cvs log <active file> o CVS status - cvs status <active file> o CVS edit - cvs edit <active file> o CVS unedit - cvs unedit <active file> o CVS watch - cvs watch add <active file>
o CVS release watch - cvs watch remove <active file> o CVS tag - cvs tag <active file> o CVS untag - cvs tag -d <active file> o CVS fork - cvs tag -b <active file> o CVS unlock - cvs admin -u <active file> Addtional toolbars: o Graph - show the graph or revisions and tags (Not yet implemented - will lauch WinCvs!) o Wizard - not frequently used CVS commands (add/delete etc.) and special tools (Not yet
implemented!) 2. Macro sheet in the Output Window. You will see all the messages from CvsIn here. 3. Status Bar - short information about the activated file will be displayed here. Currently it Displays the information about file attributes in the following way:
o [rahs] - Read-only, Archive, Hidden, System. o if the attribute is not set then the '-' is displayed. o Example: [ra--] - Read-only, Archiv file.
Note: You can use more commands and assign keybindings for easier access for all the functions. Note: To use the Status Bar you don't need to have Visual Assist and AIC installed any more, but it is still using VA in the first attempt and it is recommended configuration.
The CVS command related setup is similiar to the one you have in WinCvs, but it more basic. 1. HOME folder - setup the same HOME as in WinCvs - CVS will for the password in this directory. If you have set HOME environmental variable it will be used instead.
2. CVS client command line - it is best to have the cvs client in the PATH. If you don't want it that way you should setup the full path here. 3. Checkout Read-only - if selected then all new working files will have the Read-only attribute set. CVS global option: [-r]
4. Messages - you can set the amount of messages you get from CVS client. [-q][-Q] 5. TCP/IP compression - you can setup the level of compression during CVS oprerations 6. Other options - you can add any other options - it will be used as a global options for invoking CVS client commands.
7. External diff program - you can specify the external diff program to compare the file with the version on the server. Not yet implemented! (but you can setup path already) Few things to remmember when using CVS commands:
1. After you get he file and unzip it - you have to go to the DevStudio Tools->Customize and uninstall previous version of CvsIn (uncheck the box then click the Close). 2. Then install it again - this way you will get all the new buttons
on the screen. 3. After that - go to the CvsIn Options and make sure you have the settings of HOME and cvs client set correctly. 4. You have to make sure CvsIn can see the cvs client - either add the location of the cvs.exe to your PATH, or specify the full path
in the settings. 5. Remember that DevStudio doesn't scrool the output window - you will have to go to the "Macro" sheet of the Output window and place the cursor at the end - click there and then use "Ctrl+End".
6. Do NOT exit the DevStudio if the CVS command is running. If that happens - you will have to use the task manager and kill the process by hand. Look after "cvs". 7. If you use the DialUp connection - it is better to select the
DialUp in the CvsIn Options->CvsIn or the DialUp dialog won't popup - that is M$ bug... 8. At the moment all the buttons are working excpet the Graph(calls WinCvs) and Wizard(not finished yet). I expose the buttons already
because what you get now it the final, fixed set of buttons - for the next upgrade you will not have to uninstall CvsIn any more since the buttons won't change. All the other buttons willgo the the wizard dialog in the future.
From the CvsIn Options settings dialog you can control how launching of WinCvs is handled: 1. WinCvs path - you need to tell CvsIn where is your WinCvs installed. By default this is set to "C:\Program Files\GNU\WinCvs 1.1\wincvs.exe" where WinCvs is usually installed. You should have WinCvs 1.1b12 (or latest) version isntalled. If you installed WinCvs to the different directory you can use the browse button next to the EditBox to locate it.
2. Start in - points to the directory where WinCvs is installed. When you select the file for WinCvs path the directory will be filled in automatically. 3. Run - You can control the way WinCvs is launched, the options are:
o Normal Window - the default setting, o Minimized, o Maximized. 4. Close all on DevStudio exit - CvsIn maintains open WinCvs instances and if this checkbox is selected then it will close all running WinCvs instances under it's control when you exit DevStudio.
5. Save all documents before running WinCvs - if selected CvsIn will save all unsaved documents before run WinCvs. 6. Reuse WinCvs if still active for the same file - if selected then to avoid multipling copies of running WinCVs CvsIn will check if the instance of WinCvs is already running for that file and if it finds such instance it will just bring it to foreground.
7. Attempt to reuse WinCvs for file groups - similiar to previous option (6). CvsIn will attempt to identify the groups of files (like .cpp and corresponding header). 8. Signature - helps to identify the main window of running WinCvs. The users of some old versions of WinCvs will notice that bringing to foreground option does not keep the focus right. It is because the older version of WinCvs have no signature text in the title. Solution: Upgrade! As an alternative you can try to use " - " as a signature - select from the ComboBox. 9. Extension delimiter (period) - if option for file groups (7) is selected thee delimiter is searched from the left or right side - depending on the selection. It allows to create the files groups depending on the extension of the file or on the name of it.
From the CvsIn Options settings dialog you can change some CvsIn specific settings:
1. Output group of settings - controls CvsIn's messages: o Use Output Window - you can turn on/off the messages in the Macro sheet in the Output Window.
o Use Status Bar - you can turn on/off the messages send to the DevStudio Status Bar. This option works best if Visual Assist and AIC are installed!
o Use Log File - you can turn on/off logging messages to the Log File. Not yet implemented!
2. Warnings/Prompts group of settings - controls warious warnings: o Soft Warning - to avoid annoying message boxes etc. you can utylize the VA's let margin and status bar for warnings. Require VA, not yet implemented!
o Activate file in ../Cvs/Base/ - this warning prevents you from editing the copy of the files copied to the CVS administrative folder when use "cvs edit". o Resource files Read-only - warning if the "<proj_name>.rc" or "resource.h" is Read-0only. Not yet implemented!
3. Tools group of settings - you can find some useful tools: o View Log File - see the logged messages in the Log File. Not yet implemented! o Clear Log File - remove the contents of the log file. Not yet implemented!
4. Misc group of settings - miscellaneous options: o Dial-Up connection - set this if you are connected using Dial-Up to make sure you will see the "Connect" dialog. If you're over the LAN then uncheck.
o Save before CVS command - if set then all files will be saved before invoking CVS command.
You can now easier manipulate your WinCvs sessions. By pressing the control keys while pushing the 'RunWinCvs' button you'll get various behaviour: 1. Ctr+'RunWinCvs' - this will invoke the sessions manager, which will allow you to:
o Refresh the list of running sessions o Switch to selected seesions o Open new session for the selected file - previous session is closed! o Close the selected session
o Close all sessions Note: The list control is hot - one click activate! 2. Ctr+Shift+'RunWinCvs' - the list of active sessions will be printed to the Output Window 3. Shift+RunWinCvs - open the new WinCvs session without the attached file, regardless of the active file exists or not. It is useful to emulate the 'single instance of Browser (WinCvs)' working model model.
您好: 在网上搜到这个,进来看了看,请问 typedef union
{ # if __WORDSIZE == 64 struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; //这代表什么? unsigned int __nr_readers_queued; unsigned int __nr_writers_queued;
int __writer; int __pad1; unsigned long int __pad2; unsigned long int __pad3; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; } __data;
# else struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; /* FLAGS must stay at this position in the structure to maintain
binary compatibility. */ unsigned int __flags; int __writer; } __data; # endif char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; 我尝试线程获取读锁后不释放,由线程清理函数pthread_cleanup_push调用注册的回调函数释放未释放的写锁,结果该字段不为0,尽管可以工作,但仍感觉不妥,请问怎么解决?
http://www.mcublog.com/blog/user1/5/archives/2007/24235.html
HOWTO: How to Use PeekMessage() Correctly in Windows
SUMMARY
In the Windows environment, many applications use a PeekMessage()
loop to perform background processing. Such applications must allow the Windows system to enter an idle state when their background processing is complete. Otherwise, system performance, "idle-time" system processes such as paging optimizations, and power management on battery-powered systems will be adversely affected.
While an application is in a PeekMessage() loop, the Windows system cannot go idle. Therefore, an application should not remain in a PeekMessage() loop after its background processing has completed.
NOTE: The PeekMessage method described in this article is only needed if your application is a 32-bit application for Windows and is, for some reason, unable to create threads and perform background processing.
MORE INFORMATION
Many Windows-based applications use PeekMessage() to retrieve messages while they are in the middle of a long process, such as printing, repaginating, or recalculating, that must be done "in the background."
PeekMessage() is used in these situations because, unlike GetMessage(), it does not wait for a message to be placed in the queue before it returns.
An application should not call
PeekMessage() unless it has background processing to do between the calls to PeekMessage(). When an application is waiting for an input event, it should call GetMessage()
or WaitMessage().
Remaining in a PeekMessage() loop when there is no background work causes system performance problems. A program in a PeekMessage() loop continues to be rescheduled by the Windows scheduler, consuming CPU time and taking time away from other processes.
In enhanced mode, the Virtual Machine (VM) in which Windows is running will not appear to be idle as long as an application is calling the PeekMessage function. Therefore, the Windows VM will continue to receive a considerable fraction of CPU time.
Many power management methods employed on laptop and notebook computers are based on the system going idle when there is no processing to do. An application that remains in a PeekMessage() loop will make the system appear busy to power management software, resulting in excessive power consumption and shortening the time that the user can run the system.
In the future, the Windows system will make more and more use of idle time to do background processing, which is designed to optimize system performance. Applications that do not allow the system to go idle will adversely affect the performance of these techniques.
All these problems can be avoided by calling the PeekMessage() function only when there is background work to do, and calling GetMessage() or WaitMessage() when there is no background work to do.
For example, consider the following PeekMessage() loop. If there is no background processing to do, this loop will continue to run without waiting for messages, preventing the system from going idle and causing the negative effects described above.
// This PeekMessage loop will NOT let the system go idle.
for( ;; ) {
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE
)) { if (msg.message == WM_QUIT) return TRUE;
TranslateMessage(&msg); DispatchMessage(&msg); }
BackgroundProcessing(); }
This loop can be rewritten in two ways, as shown below. Both of the following PeekMessage() loops have two desirable properties:
•
They process all input messages before performing background processing, providing good response to user input.
•
The application "idles" (waits for an input message) when no background processing needs to be done.
Improved PeekMessage Loop 1
// Improved PeekMessage() loop
for(;;) {
while (PeekMessage(&msg, NULL
, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) return
TRUE;
TranslateMessage(&msg); DispatchMessage(&msg);
}
if (IfBackgroundProcessingRequired()) BackgroundProcessing();
else WaitMessage(); // Will not return until a message is posted.
}
Improved PeekMessage Loop 2
// Another improved PeekMessage() loop
for (;;) {
for (;;) { if (IfBackgroundProcessingRequired())
{ if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
break; } else GetMessage(&msg, NULL, 0, 0, 0);
Note that calls to functions such as IsDialogMessage() and TranslateAccelerator() can be added to these loops as appropriate.
There is one case in which the loops above need additional support: if the application waits for input from a device (for example, a fax board) that does not send standard Windows messages. For the reasons outlined above, a Windows-based application should not use a
PeekMessage() loop to continuously poll the device. Rather, implement an Interrupt Service Routine (ISR) in a Dynamic-Link Library (DLL). When the ISR is called, the DLL can use the PostMessage
function to inform the application that the device requires service. DLL functions can safely call the PostMessage() function because the PostMessage() function is reentrant.