From d6cfcf46a8f3ec03e2f805aca6e5012eb6633803 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 27 Feb 2013 22:16:33 -0500 Subject: [PATCH] Windows: Move grmutex, etc. to afspthread.dll afsauthent.dll exported: pthread_recursive_mutex_lock pthread_recursive_mutex_unlock grmutex (DATA) even though a dedicated afspthread.dll existed and all pthreaded modules must link to afspthread.dll and not all link to afsauthent.dll. Move these functions and the global mutex variable to afspthread.dll to ensure that only one instance of the variable is present in any binary. Also remove from src/libafsauthent/NTMakefile the local building of src/util object files and link to mtafsutil.lib. Change-Id: I9f8e76165f9c1b1be7ed1a90cdaac03b629d9591 Reviewed-on: http://gerrit.openafs.org/9303 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/pthread/NTMakefile | 10 +++++++++- src/WINNT/pthread/pthread.def | 3 +++ src/libafsauthent/NTMakefile | 17 +---------------- src/libafsauthent/afsauthent.def | 6 +++--- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/WINNT/pthread/NTMakefile b/src/WINNT/pthread/NTMakefile index 0ed18a3..8030ab5 100644 --- a/src/WINNT/pthread/NTMakefile +++ b/src/WINNT/pthread/NTMakefile @@ -20,6 +20,8 @@ LIBINCLUDES = \ PTHR_DLLFILE = $(DESTDIR)\lib\afspthread.dll +UTIL = ..\..\util + $(OUT)\pthread.res: pthread.rc AFS_component_version_number.h $(RC) /fo$*.res $(*F).rc @@ -27,7 +29,13 @@ PTHR_DLLOBJS = \ $(OUT)\pthread.obj \ $(OUT)\pthread.res -$(PTHR_DLLFILE): $(PTHR_DLLOBJS) +UTILOBJS = \ + $(OUT)\pthread_glock.obj + +$(UTILOBJS): $(UTIL)\$$(@B).c + $(C2OBJ) -I$(UTIL) -DAFS_PTHREAD_ENV $** + +$(PTHR_DLLFILE): $(PTHR_DLLOBJS) $(UTILOBJS) $(DLLCONLINK) /DEF:pthread.def $(_VC_MANIFEST_EMBED_DLL) $(DLLPREP) diff --git a/src/WINNT/pthread/pthread.def b/src/WINNT/pthread/pthread.def index 387c1bf..1bb9a5d 100644 --- a/src/WINNT/pthread/pthread.def +++ b/src/WINNT/pthread/pthread.def @@ -33,3 +33,6 @@ EXPORTS pthread_rwlock_tryrdlock @31 pthread_rwlock_trywrlock @32 pthread_rwlock_unlock @33 + pthread_recursive_mutex_lock @34 + pthread_recursive_mutex_unlock @35 + grmutex @36 DATA diff --git a/src/libafsauthent/NTMakefile b/src/libafsauthent/NTMakefile index 1a04fb3..2296d8c 100644 --- a/src/libafsauthent/NTMakefile +++ b/src/libafsauthent/NTMakefile @@ -19,7 +19,6 @@ AUDIT = ..\audit AUTH = ..\auth KAUTH = ..\kauth UBIK = ..\ubik -UTIL = ..\util RXKAD = ..\rxkad PTSERVER = ..\ptserver SYS = ..\sys @@ -68,12 +67,6 @@ UBIKOBJS = \ $(OUT)\ubik_int.cs.obj \ $(OUT)\ubik_int.xdr.obj -UTILOBJS = \ - $(OUT)\pthread_glock.obj \ - $(OUT)\fileutil.obj \ - $(OUT)\dirpath.obj \ - $(OUT)\readdir_nt.obj - RXKADOBJS = \ $(OUT)\rxkad_errs.obj @@ -95,7 +88,6 @@ DLLOBJS =\ $(AUTHOBJS) \ $(KAUTHOBJS) \ $(UBIKOBJS) \ - $(UTILOBJS) \ $(RXKADOBJS) \ $(PTSERVEROBJS) \ $(SYSOBJS) \ @@ -115,9 +107,6 @@ $(KAUTHOBJS): $(KAUTH)\$$(@B).c $(UBIKOBJS): $(UBIK)\$$(@B).c $(C2OBJ) -I$(UBIK) $** -$(UTILOBJS): $(UTIL)\$$(@B).c - $(C2OBJ) -I$(UTIL) $** - $(RXKADOBJS): $(RXKAD)\$$(@B).c $(C2OBJ) -I$(RXKAD) $** @@ -134,13 +123,9 @@ $(SYSOBJS): $(SYS)\$$(@B).c $(C2OBJ) -I$(SYS) $** DLLLIBS =\ -!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" )) - $(DESTDIR)\lib\win95\afspthread.lib \ -!ELSE $(DESTDIR)\lib\afspthread.lib \ -!ENDIF $(DESTDIR)\lib\afsrpc.lib \ - $(DESTDIR)\lib\afs\afsutil.lib \ + $(DESTDIR)\lib\afs\mtafsutil.lib \ $(DESTDIR)\lib\afs\afsreg.lib \ $(DESTDIR)\lib\afs\afseventlog.lib \ $(DESTDIR)\lib\afs\afsprocmgmt.lib \ diff --git a/src/libafsauthent/afsauthent.def b/src/libafsauthent/afsauthent.def index e62cd8d..72e6cd4 100644 --- a/src/libafsauthent/afsauthent.def +++ b/src/libafsauthent/afsauthent.def @@ -49,9 +49,9 @@ EXPORTS ubik_ParseClientList @49 getDirPath @50 ka_AuthSpecificServersConn @51 - pthread_recursive_mutex_lock @52 - pthread_recursive_mutex_unlock @53 - grmutex @54 DATA +; pthread_recursive_mutex_lock @52 +; pthread_recursive_mutex_unlock @53 +; grmutex @54 DATA initAFSDirPath @55 ; renamefile @56 opendir @57 -- 1.9.4