Re: [ford@vss.fsi.com: [PATCH] Trivial pthread testsuite fixes]

2003-03-27 Thread Robert Collins
On Thu, 2003-03-27 at 18:45, Thomas Pfaff wrote:
> Christopher Faylor wrote:
> > I assume that these patches are to clean up some warnings.  Do they
> > make sense?
> > 
> 
> Yes.
> I have recognized these warnings yesterday too and will apply the patch.

Thank you.

Rob
-- 
GPG key available at: .


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] performance patch for /proc/registry -- version 2

2003-03-27 Thread Corinna Vinschen
On Wed, Mar 26, 2003 at 04:47:26PM -0500, Joe Buehler wrote:
> Corinna Vinschen wrote:
> 
> >However... am I doing something wrong?  I'm trying to find out what the
> >performance improvement is on my XP box and both versions of the DLL
> >(w/ and w/o your patch) are running 7.5 minutes for 
> >
> >  ls -lR /proc/registry > /dev/null
> >
> >Or is that only a problem on older systems?  You're running NT4SP5, right?
> >
> >Other than that your patch looks fine.
> 
> It may be that XP has the WIN32 API fixed.  The different is drastic
> on my NT4 SP5 box.  You can see the difference just by doing
> ls -l /proc/registry/HKEY_LOCAL_MACHINE.  With patch comes back instantly,
> without you have to sit and wait.

Applied.

Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Corinna Vinschen
On Thu, Mar 27, 2003 at 08:00:24AM -, Elfyn McBratney wrote:
> > I've been working on a new option for `cygcheck' that checks who Cygwin
> was
> > installed for. This could be used when users on the mailing list have
> > problems running services when the installation was done for "Just Me",
> > executing files in the same situation etc. Would this be a desirable
> > feature? Yes/no...patch attached :-)
> 
> Sorry, forgot this...
> 
> 2003-03-27  Elfyn McBratney  <[EMAIL PROTECTED]>
> 
> * utils/cygcheck.cc (longopts): Add install-type option.
> (opts): Add 'i' install-type option.
> (check_install_type): New function.
> (main): Accommodate new install_type option.

Well, the problem is that you're checking in HKLM first.  You should
check the HKCU key first since this would override the existing same
key in HKLM.  Probably it would be nice(tm) if cygcheck reports
always both keys if they both exist and print some warning about this
(hmm, I'm musing if it makes sense to print a suggestion to drop the
HKCU key in that case...)

Corinna

PS: Your ChangeLog is incorrect (think "tabs") ;-)

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [PATCH] The great pthread rename

2003-03-27 Thread Robert Collins
On Thu, 2003-03-27 at 22:11, Thomas Pfaff wrote:
> Do not try to force me to comment every bit of this patch ;-)
> 
> 2003-03-27  Thomas Pfaff  <[EMAIL PROTECTED]>
> 
>   * thread.h: Change class names, methods, members and local vars
>   according to the GNU coding style.
>   * thread.cc: Ditto.
>   * dcrt0.cc (dll_crt0_1): Rename pthread::initMainThread call to
>   pthread::init_mainthread.
>   * pthread.cc (pthead_getsequence_np): Rename pthread::isGoodObject
>   call to pthread::is_good_object.

Reminds me why I don't require the GNU standards for setup.exe :}.

Thanks, and please apply.

Rob
-- 
GPG key available at: .


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Max Bowsher
Corinna Vinschen wrote:
> On Thu, Mar 27, 2003 at 08:00:24AM -, Elfyn McBratney wrote:
>>> I've been working on a new option for `cygcheck' that checks who Cygwin
>>> was installed for. This could be used when users on the mailing list
>>> have problems running services when the installation was done for "Just
>>> Me", executing files in the same situation etc. Would this be a
>>> desirable feature? Yes/no...patch attached :-)
>>
>> Sorry, forgot this...
>>
>> 2003-03-27  Elfyn McBratney  <[EMAIL PROTECTED]>
>>
>> * utils/cygcheck.cc (longopts): Add install-type option.
>> (opts): Add 'i' install-type option.
>> (check_install_type): New function.
>> (main): Accommodate new install_type option.
>
> Well, the problem is that you're checking in HKLM first.  You should
> check the HKCU key first since this would override the existing same
> key in HKLM.  Probably it would be nice(tm) if cygcheck reports
> always both keys if they both exist and print some warning about this
> (hmm, I'm musing if it makes sense to print a suggestion to drop the
> HKCU key in that case...)
>
> Corinna
>
> PS: Your ChangeLog is incorrect (think "tabs") ;-)

Outlook Express doesn't do tabs.

Unfortunately, I've never found another email client that wasn't either ugly
or buggy or user-unfriendly.

Max.



[PATCH] Change pthread equations

2003-03-27 Thread Thomas Pfaff

2003-03-27  Thomas Pfaff  <[EMAIL PROTECTED]>

* thread.cc: Change 1==foo equations to foo==1 throughout.
diff -urp src.old/winsup/cygwin/thread.cc src/winsup/cygwin/thread.cc
--- src.old/winsup/cygwin/thread.cc 2003-03-27 12:56:03.0 +0100
+++ src/winsup/cygwin/thread.cc 2003-03-27 13:04:32.0 +0100
@@ -606,7 +606,7 @@ pthread::testcancel (void)
   if (cancelstate == PTHREAD_CANCEL_DISABLE)
 return;
 
-  if (WAIT_OBJECT_0 == WaitForSingleObject (cancel_event, 0))
+  if (WaitForSingleObject (cancel_event, 0) == WAIT_OBJECT_0)
 cancel_self ();
 }
 
@@ -904,7 +904,7 @@ pthread_cond::wait (pthread_mutex_t mute
   DWORD rv;
 
   mtx_in.lock ();
-  if (1 == InterlockedIncrement ((long *)&waiting))
+  if (InterlockedIncrement ((long *)&waiting) == 1)
 mtx_cond = mutex;
   else if (mtx_cond != mutex)
 {
@@ -931,7 +931,7 @@ pthread_cond::wait (pthread_mutex_t mute
* or timed out. Try to take one.
* If the thread gets one than a signal|broadcast is in progress.
*/ 
-  if (WAIT_OBJECT_0 == WaitForSingleObject (sem_wait, 0))
+  if (WaitForSingleObject (sem_wait, 0) == WAIT_OBJECT_0)
 /*
  * thread got cancelled ot timed out while a signalling is in progress.
  * Set wait result back to signaled
@@ -941,7 +941,7 @@ pthread_cond::wait (pthread_mutex_t mute
 
   InterlockedDecrement ((long *)&waiting);
 
-  if (rv == WAIT_OBJECT_0 && 0 == --pending)
+  if (rv == WAIT_OBJECT_0 && --pending == 0)
 /*
  * All signaled threads are released,
  * new threads can enter Wait
@@ -1450,7 +1450,7 @@ pthread_mutex::can_be_unlocked (pthread_
   /*
* Check if the mutex is owned by the current thread and can be unlocked
*/
-  return (pthread_equal ((*mutex)->owner, self)) && 1 == (*mutex)->recursion_counter;
+  return ((*mutex)->recursion_counter == 1 && pthread_equal ((*mutex)->owner, self));
 }
 
 List pthread_mutex::mutexes;
@@ -1510,12 +1510,12 @@ pthread_mutex::_lock (pthread_t self)
 {
   int result = 0;
 
-  if (1 == InterlockedIncrement ((long *)&lock_counter))
+  if (InterlockedIncrement ((long *)&lock_counter) == 1)
 set_owner (self);
-  else if (PTHREAD_MUTEX_NORMAL != type && pthread_equal (owner, self))
+  else if (type != PTHREAD_MUTEX_NORMAL && pthread_equal (owner, self))
 {
   InterlockedDecrement ((long *) &lock_counter);
-  if (PTHREAD_MUTEX_RECURSIVE == type)
+  if (type == PTHREAD_MUTEX_RECURSIVE)
result = lock_recursive ();
   else
result = EDEADLK;
@@ -1534,9 +1534,9 @@ pthread_mutex::_trylock (pthread_t self)
 {
   int result = 0;
 
-  if (0 == InterlockedCompareExchange ((long *)&lock_counter, 1, 0 ))
+  if (InterlockedCompareExchange ((long *)&lock_counter, 1, 0 ) == 0)
 set_owner (self);
-  else if (PTHREAD_MUTEX_RECURSIVE == type && pthread_equal (owner, self))
+  else if (type == PTHREAD_MUTEX_RECURSIVE && pthread_equal (owner, self))
 result = lock_recursive ();
   else
 result = EBUSY;
@@ -1550,7 +1550,7 @@ pthread_mutex::_unlock (pthread_t self)
   if (!pthread_equal (owner, self))
 return EPERM;
 
-  if (0 == --recursion_counter)
+  if (--recursion_counter == 0)
 {
   owner = NULL;
   if (InterlockedDecrement ((long *)&lock_counter))
@@ -1585,7 +1585,7 @@ pthread_mutex::_fixup_after_fork ()
   if (pshared != PTHREAD_PROCESS_PRIVATE)
 api_fatal ("pthread_mutex::_fixup_after_fork () doesn'tunderstand PROCESS_SHARED 
mutex's");
 
-  if (NULL == owner)
+  if (owner == NULL)
 /* mutex has no owner, reset to initial */
 lock_counter = 0;
   else if (lock_counter != 0)
@@ -2196,7 +2196,7 @@ pthread::detach (pthread_t *thread)
 }
 
   // check if thread is still alive
-  if (WAIT_TIMEOUT == WaitForSingleObject ((*thread)->win32_obj_id, 0))
+  if (WaitForSingleObject ((*thread)->win32_obj_id, 0) == WAIT_TIMEOUT)
 {
   // force cleanup on exit
   (*thread)->joiner = *thread;


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Corinna Vinschen
On Thu, Mar 27, 2003 at 11:13:12AM -, Max Bowsher wrote:
> Outlook Express doesn't do tabs.
> 
> Unfortunately, I've never found another email client that wasn't either ugly
> or buggy or user-unfriendly.

mutt?

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Earnie Boyd
Corinna Vinschen wrote:
On Thu, Mar 27, 2003 at 11:13:12AM -, Max Bowsher wrote:

Outlook Express doesn't do tabs.

Unfortunately, I've never found another email client that wasn't either ugly
or buggy or user-unfriendly.


mutt?

Mozilla mail client
is very handy.  I
typically create the
ChangeLog entry at
the top of the diff
file using vim.
	Earnie.



Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Max Bowsher
Earnie Boyd wrote:
> Corinna Vinschen wrote:
>> On Thu, Mar 27, 2003 at 11:13:12AM -, Max Bowsher wrote:
>>
>>> Outlook Express doesn't do tabs.
>>>
>>> Unfortunately, I've never found another email client that wasn't either
>>> ugly or buggy or user-unfriendly.
>>
>>
>> mutt?

Sorry, much as I love the command line, for some things I'm staying in a
GUI.

> Mozilla mail client
> is very handy.

But its buggy and slow, and pathetic at handling multiple POP accounts.

> I
> typically create the
> ChangeLog entry at
> the top of the diff
> file using vim.

In a desperate attempt to keep this email partially on topic:

You can diff a ChangeLog with -U0. Then will be applied correctly, and
without conflicts.


Max.



Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Igor Pechtchanski
On Thu, 27 Mar 2003, Corinna Vinschen wrote:

> On Thu, Mar 27, 2003 at 08:00:24AM -, Elfyn McBratney wrote:
> > > I've been working on a new option for `cygcheck' that checks who Cygwin
> > > was
> > > installed for. This could be used when users on the mailing list have
> > > problems running services when the installation was done for "Just Me",
> > > executing files in the same situation etc. Would this be a desirable
> > > feature? Yes/no...patch attached :-)
> >
> > Sorry, forgot this...
> >
> > 2003-03-27  Elfyn McBratney  <[EMAIL PROTECTED]>
> >
> > * utils/cygcheck.cc (longopts): Add install-type option.
> > (opts): Add 'i' install-type option.
> > (check_install_type): New function.
> > (main): Accommodate new install_type option.
>
> Well, the problem is that you're checking in HKLM first.  You should
> check the HKCU key first since this would override the existing same
> key in HKLM.  Probably it would be nice(tm) if cygcheck reports
> always both keys if they both exist and print some warning about this
> (hmm, I'm musing if it makes sense to print a suggestion to drop the
> HKCU key in that case...)

No, please.  If Cygwin were installed for All Users, but user mounts were
later created with "mount -u", this would cause the situation you
describe.  Since this is a perfectly legitimate use of mount, no warning
is necessary.
Igor

> Corinna
>
> PS: Your ChangeLog is incorrect (think "tabs") ;-)

-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune



Re: [PATCH] The great pthread rename

2003-03-27 Thread Christopher Faylor
On Thu, Mar 27, 2003 at 10:18:23PM +1100, Robert Collins wrote:
>On Thu, 2003-03-27 at 22:11, Thomas Pfaff wrote:
>> Do not try to force me to comment every bit of this patch ;-)
>> 
>> 2003-03-27  Thomas Pfaff  <[EMAIL PROTECTED]>
>> 
>>  * thread.h: Change class names, methods, members and local vars
>>  according to the GNU coding style.
>>  * thread.cc: Ditto.
>>  * dcrt0.cc (dll_crt0_1): Rename pthread::initMainThread call to
>>  pthread::init_mainthread.
>>  * pthread.cc (pthead_getsequence_np): Rename pthread::isGoodObject
>>  call to pthread::is_good_object.
>
>Reminds me why I don't require the GNU standards for setup.exe :}.
>
>Thanks, and please apply.

Thanks for doing this, but please don't feel compelled to fix every single
occurrence of this type of thing.  I really don't care that much.

cgf


Re: [PATCH] Change pthread equations

2003-03-27 Thread Christopher Faylor
On Thu, Mar 27, 2003 at 01:52:15PM +0100, Thomas Pfaff wrote:
>
>2003-03-27  Thomas Pfaff  <[EMAIL PROTECTED]>
>
>   * thread.cc: Change 1==foo equations to foo==1 throughout.

This one on the other hand, I do care about...  Thanks for doing this.

cgf


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Christopher Faylor
On Thu, Mar 27, 2003 at 07:30:42AM -, Elfyn McBratney wrote:
>I've been working on a new option for `cygcheck' that checks who Cygwin was
>installed for. This could be used when users on the mailing list have
>problems running services when the installation was done for "Just Me",
>executing files in the same situation etc. Would this be a desirable
>feature? Yes/no...patch attached :-)

Doesn't cygcheck already report the appropriate registry keys from HKLM
and HKCU?  If not, I think that just reporting the keys from both of those
is all that we really need to do rather than adding a special option.

cgf


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Igor Pechtchanski
On Thu, 27 Mar 2003, Christopher Faylor wrote:

> On Thu, Mar 27, 2003 at 07:30:42AM -, Elfyn McBratney wrote:
> >I've been working on a new option for `cygcheck' that checks who Cygwin was
> >installed for. This could be used when users on the mailing list have
> >problems running services when the installation was done for "Just Me",
> >executing files in the same situation etc. Would this be a desirable
> >feature? Yes/no...patch attached :-)
>
> Doesn't cygcheck already report the appropriate registry keys from HKLM
> and HKCU?  If not, I think that just reporting the keys from both of those
> is all that we really need to do rather than adding a special option.
> cgf

'cygcheck -svr' already reports both the HKLM and HKCU keys.  It also
displays both user and system mounts.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune



Re: [PATCH] Change pthread equations

2003-03-27 Thread Robert Collins
On Thu, 2003-03-27 at 23:52, Thomas Pfaff wrote:
> 2003-03-27  Thomas Pfaff  <[EMAIL PROTECTED]>
> 
>   * thread.cc: Change 1==foo equations to foo==1 throughout.

Thanks again - please apply.

I don't know if you meant to do this:
-  return (pthread_equal ((*mutex)->owner, self)) && 1 ==
(*mutex)->recursion_counter;
+  return ((*mutex)->recursion_counter == 1 && pthread_equal
((*mutex)->owner, self));

But it's actually more than just changing 1==foo to foo==1. If there
where side effects in pthread_equal, the meaning would have changed.
Rob

-- 
GPG key available at: .


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Brian Keener
Max Bowsher wrote:
> Outlook Express doesn't do tabs.
> 
> Unfortunately, I've never found another email client that wasn't either ugly
> or buggy or user-unfriendly.
> 
> Max.
>
Max,

A quick response off topic for the other off-topics.  Have you looked at 
Virtual-Access (Think VA6 you helped me with).  I have been using for a long 
time (when it was still bought software) and it just went Open Source.  I 
haven't been brave enough to use the alpha version of the Open Source Version 
yet.  Handles mail, newsgroups, threading

Http://sourceforge.net/projects/virtual-access/

back on topic

bk




Re: [PATCH] New '--install-type' option for cygcheck?

2003-03-27 Thread Elfyn McBratney
> On Thu, Mar 27, 2003 at 07:30:42AM -, Elfyn McBratney wrote:
> >I've been working on a new option for `cygcheck' that checks who Cygwin
was
> >installed for. This could be used when users on the mailing list have
> >problems running services when the installation was done for "Just Me",
> >executing files in the same situation etc. Would this be a desirable
> >feature? Yes/no...patch attached :-)
>
> Doesn't cygcheck already report the appropriate registry keys from HKLM
> and HKCU?  If not, I think that just reporting the keys from both of those
> is all that we really need to do rather than adding a special option.

I see your point. I just thought it could be an FAQ and when people ask
these kind of questions running this would be a way to tell them where to
get the help instead of having to reply run setup...blah.


Regards,

Elfyn McBratney
[EMAIL PROTECTED]
www.exposure.org.uk