Portrait/Landscape Mode Lock and Unlock.
Quickly double click the Home Button to reveal the apps. dock at the bottom of the iPhone Screen. Sweep your finger on the dock all the way to the right. You will see on the far left side of the dock an icon that depicts a circular arrow with a lock in the center of it.
Tap the lock once to lock in either portrait or landscape mode. Tap again to unlock.
You will know if your screen is locked when the accelerometer fails to switch modes. There will also be a tiny icon at the top right side of the Phones screen identical to the lock icon on the dock.
G4, Mac OS X (10.4.4)