Commit Graph

5 Commits

Author SHA1 Message Date
Aleric Inglewood
37c8ea54eb Add AIThreadID - Cleanup of apr_os_thread* related code.
Apart from just really cleaning things up and moving
everything into one class regarding thread IDs (ie,
is_main_thread(), comparing ID's etc), this also
fixes an obscure bug where LL was casting thread ID's
to U32 and then compared those to find out if it
the same thread. It's theoretically possible that
such fails on a 64bit OS.

By generalizing the interface, I adopted the use
of a thread-local cache for the current thread ID
as used by LLMutex et al, so now all code benefits
from that. The idea was even extended to now also
be used for is_main_thread() tests and even resetting
a thread ID to the ID of the current thread.
2012-08-09 06:30:31 +02:00
Aleric Inglewood
e95ee85804 Make LLFrameTimer thread-safe.
LLFrameTimer::sFrameTime is accessed by the texture
thread as well. Although the only consequences are
that it's possible for a timer in the texture thread
to time out too early (or to never time out when
it's started) when it reads this variable at the
same time as that it is updated, which is pretty
inlikely, it's just not-done to leave anything
thread-unsafe when it's known to be thread-unsafe.

This patch also adds a framework for AIFrameTimer, but
that isn't implemented yet.
2011-08-08 19:21:27 +02:00
Aleric Inglewood
d828f858c9 LLFrameTimer review and resulting changes.
This makes the class API a bit more sane, although
only a bit, because I had to leave it working with
possibly new code merged in from LL: the API can't
really change. I also removed some unused code.

While reviewing how LLFrameTimer worked however,
I did find a few instances where things where broken:

* sFrameDeltaTime wasn't correctly updated (more
  than once per frame and therefore erratic). This
  only influenced scrolling speed, but still.
* While dragging an inventory item, the scroll
  arrows of a tab container didn't work
  (LLTabContainer::handleDragAndDrop).
* Map zoom interpolation was broken (it interpolated
  between A and B, but used the already updated
  interpolation for A the next frame...
  (added mCurZoomValInterpolationStart).
2011-08-01 21:00:27 +02:00
Siana Gearz
d68736da39 Put in some changes along sg1.4 dev history. 2010-11-21 15:57:44 +01:00
Hazim Gazov
7a86d01598 Imported existing code 2010-04-02 02:48:44 -03:00