mirror of
https://github.com/webmproject/libwebp.git
synced 2026-01-06 20:29:22 +01:00
multi-thread fix: lock each entry points with a static var
we compare the current VP8GetCPUInfo pointer to the last used. This is less code overall and each implementation is still testable separately (by just changing VP8GetCPUInfo, but not a separate threads!) Change-Id: Ia13fa8ffc4561a884508f6ab71ed0d1b9f1ce59b
This commit is contained in:
@@ -347,7 +347,11 @@ extern void VP8FiltersInitMIPSdspR2(void);
|
||||
extern void WebPInitAlphaProcessingMIPSdspR2(void);
|
||||
extern void WebPInitAlphaProcessingSSE2(void);
|
||||
|
||||
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used;
|
||||
|
||||
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) {
|
||||
if (last_cpuinfo_used == VP8GetCPUInfo) return;
|
||||
|
||||
WebPMultARGBRow = WebPMultARGBRowC;
|
||||
WebPMultRow = WebPMultRowC;
|
||||
WebPApplyAlphaMultiply = ApplyAlphaMultiply;
|
||||
@@ -370,4 +374,5 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
last_cpuinfo_used = VP8GetCPUInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user